安卓平分位置layout_weight学习记录
生活随笔
收集整理的這篇文章主要介紹了
安卓平分位置layout_weight学习记录
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
weight (權重) ?使用把layout_width寫成0 ? weight 為平分剩余父容器位置
兩個標簽平分 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="vertical"android:layout_gravity=""android:gravity=""tools:context=".MainActivity"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"><TextViewandroid:layout_width="0dp"android:layout_height="match_parent"android:layout_weight="1"android:text="222222" /><TextViewandroid:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:text="3333333" /></LinearLayout></LinearLayout>
轉載于:https://www.cnblogs.com/xuexidememeda/p/10295459.html
總結
以上是生活随笔為你收集整理的安卓平分位置layout_weight学习记录的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 爬虫 (反爬)
- 下一篇: 实战dock安装和镜像的拉取