Android中android:layout_weight属性解决不同机型平均分布的适配问题
来源:互联网 发布:windows 10 蓝屏重启 编辑:程序博客网 时间:2024/05/29 12:02
设置android:layout_weight="1"属性:
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/ll_guide_home" android:layout_width="match_parent" android:paddingTop="8dp" android:layout_height="172dp" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <include android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/guide_img01" android:layout_weight="1" layout="@layout/img_text_circlestest" /> <include android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/guide_img02" android:layout_weight="1" layout="@layout/img_text_circlestest"/> <include android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/guide_img03" android:layout_weight="1" layout="@layout/img_text_circlestest"/> <include android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/guide_img04" android:layout_weight="1" layout="@layout/img_text_circlestest"/> </LinearLayout> <View android:background="@color/gray_trans" android:layout_width="match_parent" android:layout_height="12dp"/></LinearLayout>
include xml:
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/my_card_view" android:layout_gravity="center" android:layout_width="@dimen/weight48dp" android:layout_height="@dimen/height48dp" card_view:cardElevation="4dp" card_view:cardBackgroundColor="@color/colorGreen" card_view:cardCornerRadius="24dp"> <ImageView android:id="@+id/guide_icon" android:layout_width="@dimen/weight24dp" android:layout_height="@dimen/height24dp" android:layout_gravity="center" android:gravity="center" /> </android.support.v7.widget.CardView> <TextView android:id="@+id/guide_text" android:hint="分类" android:paddingTop="4dp" android:paddingBottom="4dp" android:gravity="center" android:layout_gravity="center" android:textColor="@color/colorGrey" android:layout_width="wrap_content" android:layout_height="wrap_content" /></LinearLayout>
0 0
- Android中android:layout_weight属性解决不同机型平均分布的适配问题
- Android不同机型图标适配问题
- Android 拍照不同机型的诡异问题
- android 不同机型因录音权限出现的不同问题
- Android中 android:layout_weight 属性
- Android中 android:layout_weight 属性
- android中layout的layout_weight属性介绍
- Android布局中Layout_weight的属性
- Android布局中Layout_weight的属性
- Android布局中Layout_weight的属性
- Android布局中Layout_weight的属性
- android适配不同机型需要注意的事项
- android知识回顾-----适配不同分辨率的机型
- android 机型适配问题
- android机型适配问题
- android中layout_weight属性分析
- Android中layout_weight属性详解
- android不同机型上界面适配问题
- 多重部分和问题-DP动态规划
- Nachos操作系统:Pro1_5:实现优先级调度
- 栈
- 常见的几种RuntimeException
- CCFlow开源工作流SDK流程开发模式简单教程
- Android中android:layout_weight属性解决不同机型平均分布的适配问题
- Linux根目录下各个系统文件夹的含义和用途
- make menuconfig提示'make menuconfig' requires the ncurses libraries解决方法
- MyBatis动态SQL设置
- HDU2553
- (二)java多线程之synchronized
- 蓝桥杯 算法提高 结点选择(树形DP)
- 191.Maximum Product Subarray-乘积最大子序列(中等题)
- Linux使用tcpdump抓获取WIFI包