• 相对布局之相对布局常用的两组属性


    相对布局是通过指定当前控件与兄弟控件或者是父控件之间的相对位置,从而达到控制控件位置的目的

    先看第一组属性                              

    android:layout_toLeftOf               

    android:layout_toRightOf    将当前控件的左边缘对其id所指定控件的右边缘对齐

    android:layout_below

    android:layout_above

    <TextView
            android:id="@+id/textViewId"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#FF0000"
            android:text="第一个textview" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#00FF00"
            android:layout_toRightOf="@id/textViewId"
            android:text="第二个textview" />

    其它的都类似。

    第二组属性

    android:layout_alignLeft            将当前控件的左边缘与其id所指定的控件的右边缘对其(与上类似)

    android:layout_alignRight

    android:layout_alignTop

    android:layout_alignBottom

    (这两者在我看来可以相互换用没有发现区别,具体看Mars老师的视频13集,欢迎交流)

  • 相关阅读:
    Redis安装部署
    传输方式Topic和Queue的对比
    Hudson配置及使用
    linux 绿色版 bes 6.6服务安装
    LINUX磁盘管理
    并发用户数与 TPS 之间的关系
    性能测试场景
    计算并发用户数的五种方法
    让selenium自动化脚本运行的更快的技巧
    Jmeter学习
  • 原文地址:https://www.cnblogs.com/mercuryli/p/4410369.html
Copyright © 2020-2023  润新知