zoukankan      html  css  js  c++  java
  • android学习笔记三--Activity 布局

    1、线性布局

    标签 :<LinearLayout></LinearLayout>

    方向:android:orientation, 垂直:vertical 水平:Horizontal 

    控件所占比例:android:layout_weight

    2、表格布局

    标签:<TableLayout></TableLayout>

    行标签:<TableRow></TableRow>

    拉伸列:android:stretchColumns 如:“1” 表格填满父窗体的情况下 拉伸第2列以填满表格

    布局技巧:最后一列靠右对齐,如android:gravity="right"  中间列居中对齐 

    3、相对布局

    标签:<RelativeLayout></RelativeLayout>

    android:layout_above 将控件置于指定id的控件上面对齐

    android:layout_below 将控件置于指定id的控件下面对齐

    android:layout_toLeftOf 将控件右边缘与指定id的控件左边对齐 

    android:layout_toRightOf 将控件左边缘与指定id的控件右边对齐 

    android:layout_alignLeft 将控件左边缘与指定id控件左边对齐

    android:layout_alignRight将控件右边缘与指定id控件的右边缘对齐

    android:layout_alignTop将控件上边缘与指定id控件的上边缘对齐

    android:layout_alignBottom将控件底边缘与指定id控件的底边缘对齐

    android:layout_alignBaseline 基准线对齐

    android:layout_alignParentBottom 如果该值为True 则将该控件的底部与父控件的底部对齐

    android:layout_alignParentTop 如果该值为True 则将该控件的顶部与父控件的顶部对齐

    android:layout_alignParentLeft 如果该值为True 则将该控件的左边与父控件的左边对齐

    android:layout_alignParentRight 如果该值为True 则将该控件的右边与父控件的右边对齐

    android:layout_centerHorizontal 如果该值为True 该控件将被置于水平方向的中央

    android:layout_centerVertical 如果该值为True 该控件将被置于垂直方向的中央

    android:layout_centerInParent 如果该值为True  该控件将被置于父控件水平方向和垂直方向的中央

  • 相关阅读:
    Bootstrap+Angularjs自制弹框
    【2019年04月22日】A股最便宜的股票
    沪深300指数的跟踪基金排名
    【2019年04月10日】股票的滚动市盈率PE最低排名
    【2019年04月09日】A股净资产收益率ROE最高排名
    基金 、社保和QFII等机构的重仓股排名评测
    【2019年04月04日】股市指数估值排名
    【2019年04月03日】A股最便宜的股票
    净资产收益率ROE连续3年超过15%的股票排名
    A股滚动净利润增速最高排名
  • 原文地址:https://www.cnblogs.com/zahxz/p/3585864.html
Copyright © 2011-2022 走看看