zoukankan      html  css  js  c++  java
  • 相对嵌套布局

    下面是软件运行时的界面:


    xml代码如下

      1. <?xml version="1.0" encoding="UTF-8"?>  
      2. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
      3.     android:id="@+id/RelativeLayout_bg" android:layout_width="fill_parent"  
      4.     android:layout_height="fill_parent">  
      5.     <!-- 头部 -->  
      6.     <RelativeLayout   
      7.         android:id="@+id/MyLayout_top"  
      8.         android:orientation="horizontal"   
      9.         android:layout_width="fill_parent"  
      10.         android:layout_height="20dp"   
      11.         android:layout_alignParentTop="true"  
      12.         android:gravity="center">  
      13.         <TextView  
      14.             android:id="@+id/view_top"   
      15.             android:layout_width="wrap_content"  
      16.             android:layout_height="wrap_content"   
      17.             android:textColor="#FF00ff00"   
      18.             android:text="顶部标题"  />  
      19.     </RelativeLayout>  
      20.     <!-- 底部 -->  
      21.     <RelativeLayout   
      22.         android:id="@+id/MyLayout_bottom"  
      23.         android:orientation="horizontal"   
      24.         android:layout_width="fill_parent"  
      25.         android:layout_height="40dp"   
      26.         android:layout_alignParentBottom="true"  
      27.         android:gravity="center">  
      28.         <Button   
      29.             android:id="@+id/Button_goMain"   
      30.             android:text="底部按钮"  
      31.             android:layout_width="wrap_content"   
      32.             android:layout_height="wrap_content" />  
      33.     </RelativeLayout>  
      34.     <!-- 中部 -->  
      35.     <RelativeLayout   
      36.         android:orientation="horizontal"  
      37.         android:layout_width="fill_parent"   
      38.         android:layout_height="fill_parent"  
      39.         android:layout_above="@id/MyLayout_bottom"   
      40.         android:layout_below="@id/MyLayout_top">  
      41.             <!-- 中部左侧栏 -->  
      42.             <LinearLayout  
      43.             android:id="@+id/MyLayout_middleleft"  
      44.             android:orientation="vertical"   
      45.             android:layout_width="60dp"  
      46.             android:layout_height="fill_parent"   
      47.             android:background="#1d2152"  
      48.             android:layout_alignParentLeft="true"  
      49.             android:gravity="center">  
      50.                     <TextView  
      51.                         android:id="@+id/view_middleleft"   
      52.                         android:layout_width="wrap_content"  
      53.                         android:layout_height="wrap_content"   
      54.                         android:textColor="#FF00cc00"   
      55.                         android:text="左侧标题         "  />  
      56.             </LinearLayout>  
      57.             <!-- 中部主框架 -->  
      58.             <LinearLayout   
      59.             android:id="@+id/LinearLayoutMiddle"  
      60.             android:orientation="vertical"  
      61.             android:layout_width="fill_parent"   
      62.             android:layout_height="fill_parent"  
      63.             android:background="#eeccee"  
      64.             android:gravity="center"  
      65.             android:layout_toRightOf="@id/MyLayout_middleleft">  
      66.                     <TextView   
      67.                     android:id="@+id/view_middle_area"   
      68.                     android:layout_width="wrap_content"  
      69.                     android:layout_height="wrap_content"   
      70.                     android:textColor="#000066"   
      71.                     android:text="主面板标题" />  
      72.             </LinearLayout>  
      73.             <!-- 中部右侧栏 -->  
      74.             <LinearLayout  
      75.             android:orientation="vertical"  
      76.             android:layout_width="60dp"  
      77.             android:layout_height="fill_parent"  
      78.             android:background="#1d2152"  
      79.             android:layout_alignParentRight="true"  
      80.             android:gravity="center">  
      81.                     <TextView   
      82.                     android:id="@+id/view_middle_right_area"   
      83.                     android:layout_width="wrap_content"  
      84.                     android:layout_height="wrap_content"   
      85.                     android:textColor="#000066"   
      86.                     android:text="右标题" />  
      87.             </LinearLayout>  
      88.     </RelativeLayout>  
      89. </RelativeLayout> 
  • 相关阅读:
    正则表达式
    运算符重载 hash原理 Equals方法
    接口 类型转换 try-catch(学习笔记)
    综合练习:词频统计
    组合数据类型综合练习
    Python基础综合练习
    熟悉常用的Linux操作
    大数据概述
    递归下降分析法
    有穷状态自动机
  • 原文地址:https://www.cnblogs.com/stephen-init/p/3516577.html
Copyright © 2011-2022 走看看