zoukankan      html  css  js  c++  java
  • Android突击:PanelLayout的实现

    相对布局和线性布局的结合的例子

    1. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    2. android:layout_width="fill_parent"
    3. android:layout_height="fill_parent" >
    4. <!-- 顶部 -->
    5. <RelativeLayout
    6. android:id="@+id/relativelayout_top"
    7. android:layout_width="fill_parent"
    8. android:layout_height="50dp"
    9. android:layout_alignParentTop="true"
    10. android:background="#FF0000"
    11. android:gravity="center" >
    12. <TextView
    13. android:id="@+id/view_top"
    14. android:layout_width="wrap_content"
    15. android:layout_height="wrap_content"
    16. android:text="顶部标题"
    17. android:textColor="#FFFF00" />
    18. </RelativeLayout>
    19. <!-- 底部 -->
    20. <RelativeLayout
    21. android:id="@+id/relativelayout_bottom"
    22. android:layout_width="fill_parent"
    23. android:layout_height="50dp"
    24. android:background="#00FFFF"
    25. android:layout_alignParentBottom="true"
    26. android:gravity="center" >
    27. <TextView
    28. android:id="@+id/view_top"
    29. android:layout_width="wrap_content"
    30. android:layout_height="wrap_content"
    31. android:text="底部标题"
    32. android:textColor="#0000FF" />
    33. </RelativeLayout>
    34. <!-- 中部 -->
    35. <LinearLayout
    36. android:layout_width="fill_parent"
    37. android:layout_height="fill_parent"
    38. android:layout_above="@id/relativelayout_bottom"
    39. android:layout_below="@+id/relativelayout_top"
    40. android:orientation="horizontal" >
    41. <!-- 中部左侧栏 -->
    42. <RelativeLayout
    43. android:id="@+id/relativelayout_middleleft"
    44. android:layout_width="200dp"
    45. android:layout_height="fill_parent"
    46. android:layout_alignParentLeft="true"
    47. android:background="#FF00FF"
    48. android:gravity="center"
    49. android:orientation="vertical" >
    50. <TextView
    51. android:id="@+id/view_middleleft"
    52. android:layout_width="wrap_content"
    53. android:layout_height="wrap_content"
    54. android:text="左侧标题"
    55. android:textColor="#FFFFFF" />
    56. </RelativeLayout>
    57. <!-- 中部主框架 -->
    58. <LinearLayout
    59. android:layout_width="fill_parent"
    60. android:layout_height="fill_parent"
    61. android:layout_toRightOf="@id/relativelayout_middleleft"
    62. android:background="#eeccee"
    63. android:gravity="center"
    64. android:orientation="vertical" >
    65. <TextView
    66. android:layout_width="wrap_content"
    67. android:layout_height="wrap_content"
    68. android:text="右侧标题"
    69. android:textColor="#000066" />
    70. </LinearLayout>
    71. </LinearLayout>
    72. </RelativeLayout>





  • 相关阅读:
    Charles抓包工具的使用
    C++中引用(&)的用法和应用实例
    机器学习-斯坦福:学习笔记7-最优间隔分类器问题
    机器学习-斯坦福:学习笔记6-朴素贝叶斯
    机器学习-斯坦福:学习笔记5-生成学习算法
    机器学习-斯坦福:学习笔记4-牛顿方法
    机器学习-斯坦福:学习笔记3-欠拟合与过拟合概念
    机器学习-斯坦福:学习笔记2-监督学习应用与梯度下降
    机器学习-斯坦福:学习笔记1-机器学习的动机与应用
    相似性计算方法
  • 原文地址:https://www.cnblogs.com/zhuzhenfeng/p/4637791.html
Copyright © 2011-2022 走看看