Android weight权重适配
来源:互联网 发布:趣发现是什么软件 编辑:程序博客网 时间:2024/05/24 22:41
手机的屏幕适配,有很多种方式,其中一种就是权重适配。
效果图:
第一行比例:1:1
第二行比例:1:1:1
示例代码如下:
<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="match_parent" android:orientation="vertical" tools:context=".MainActivity" > <LinearLayout android:layout_width="match_parent" android:layout_height="100dp" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="1" android:background="#f00" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="1" android:background="#0f0" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="100dp" android:orientation="horizontal" android:weightSum="3" > <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="1" android:background="#0f0" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="1" android:background="#f00" /> </LinearLayout></LinearLayout>
0 0
- Android weight权重适配
- android基础 --- 权重(weight)
- android weight(权重值) match_parent
- android中权重属性(weight)
- Android线性布局权重Weight效果展示
- android weight(权重)的具体分析
- android之线性布局LinearLayout以及weight权重使用
- Android LinearLayout布局嵌套及权重weight的使用
- 小玩Android布局中的weight(权重)
- 关于 android 权重 weight在布局中的理解和使用
- Android自适应布局(关于权重weight的使用技巧!)
- 权重weight的使用
- LinearLayout的weight(权重属性)
- Android 布局之LinearLayout 子控件weight权重的作用详析
- Android 布局之LinearLayout 子控件weight权重的作用详析
- Android 布局之LinearLayout 子控件weight权重的作用详析
- Android中weight 出现权重大但是所占的比例小问题
- Android 布局之LinearLayout 子控件weight权重的作用详析
- C++中export关键字的尴尬处境
- 适合于图像处理方向的SCI期刊杂志列表
- 从“增信”到“征信”:互联网金融时代的中国个人征信体系发展
- 选择ABBYY PDF Transformer+ 三大理由
- 终于暂时解决了actionbar溢出菜单显示图标的问题
- Android weight权重适配
- static使用相关详解
- php中使用引用和global
- 静态注册的广播每次接收广播都会重新生成一个接收广播的对象
- vs2012 遇到 First_Chance Exception 的问题
- 关于viewpager+fragment中嵌套viewpager+fragment的问题处理:
- HTML + CSS短标题(二,三,四文字长度)两端对齐的方式
- css笔记
- do...while(0)的妙用