FrameLayout小记

 FrameLayout的功能其实之前已经了解的很清楚了,奈何总是畏惧对未知事物的使用,在开发中几乎不使用,不过今天的界面开发中有了一个关于FrameLayout很实用的一个布局。
新浪微博有一个发送字数不得超过140个字符的限制,在一个EditText里输入的时候最好是右下角加一个变动的TextView来表明当前已经输入的字符数量和最多可以输入字符的数量的一个表示,比如输入到100个字符的时候,显示“100/140”。
这个布局我们就可以使用FrameLayout的形式
  • 列表

    android:layout_width=“match_parent”
    android:layout_height = “match_parent”

    android:id=“@+id/etComment”
    android:layout_width=“match_parent”
    android:layout_height=“match_parent”

    android:id=“@+id/tvNum”
    android:layout_width=“60dp”
    android:layout_height=“wrap_content”

    android:layout_gravity=“right|bottom”
    android:margin_bottom=“10sp”

你可能感兴趣的:(FrameLayout小记)