• 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  该控件将被置于父控件水平方向和垂直方向的中央

  • 相关阅读:
    【NOIP2018PJ正式赛】摆渡车
    【NOIP2018PJ正式赛】龙虎斗
    【NOIP2018PJ正式赛】标题统计
    高精度除单精度
    关于输出的东东
    高精度乘单精度
    【NOIP2012模拟10.26】电影票
    【NOIP2012模拟10.26】雕塑
    【NOIP2012模拟10.26】火炬手
    【NOIP2016提高A组模拟9.7】千帆渡
  • 原文地址:https://www.cnblogs.com/zahxz/p/3585864.html
Copyright © 2020-2023  润新知