安卓平分位置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安装和镜像的拉取