• 相对嵌套布局


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


    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> 
  • 相关阅读:
    JQuery -- this 和 $(this) 的区别
    js动态生成表格
    Sublime 3 如何使用列编辑模式
    新版Sublime text3注册码被移除的解决办法
    Sublime text 3 格式化HTML/css/js/json代码 插件
    mingw64 构建 Geos
    C++调用Python浅析
    linux下挂载VHD等虚拟磁盘文件
    linux 下Qt WebEngine 程序打包简单记录
    C++ UTF8和UTF16互转代码
  • 原文地址:https://www.cnblogs.com/stephen-init/p/3516577.html
Copyright © 2020-2023  润新知