Android weight布局均分和width(height)的一点关联
来源:互联网 发布:淘宝培训靠谱吗 编辑:程序博客网 时间:2024/05/29 12:37
<LinearLayout android:id="@+id/project_content_value_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/detail_item_circleProgress_frame" android:gravity="center_vertical"> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1.0" android:gravity="center" android:orientation="vertical"> <TextView style="@style/act_immediacy_detial_text" android:text="借款金额(¥)" /> <TextView android:id="@+id/tv_amount" style="@style/act_immediacy_detail_content_text" /> </LinearLayout> <View android:layout_width="1dp" android:layout_height="25dp" android:background="@color/black_darkline"></View> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1.0" android:gravity="center" android:orientation="vertical"> <TextView style="@style/act_immediacy_detial_text" android:text="预期年化" /> <TextView android:id="@+id/tv_rate" style="@style/act_immediacy_detail_content_text" /> </LinearLayout> <View android:layout_width="1dp" android:layout_height="25dp" android:background="@color/black_darkline"></View> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1.0" android:gravity="center" android:orientation="vertical"> <TextView android:id="@+id/tv_limit" style="@style/act_immediacy_detial_text" android:text="借款期限" /> <TextView android:id="@+id/tv_maturity" style="@style/act_immediacy_detail_content_text" /> </LinearLayout></LinearLayout>
重点:最里层的LinearLayout属性
width="0dp"和width="wrap_content"
当with="0dp"加上weight权重,里层的LinearLayout是等比分的
当with="wrap_content"加上weight权重,里层的LinearLayout会尽可能的包含里面的内容,这样就会造成“不均分”现象!!!
这个现象在listview中较为突出!!!
0 0
- Android weight布局均分和width(height)的一点关联
- 布局时候width和height的计算
- Android 屏幕 width 和 height 的获取
- android-获取View的Width和Height-随心
- 每天一点--css中min-height,min-weight,max-height,max-weight的妙用
- android动态获取TextView的属性(width、height、line)
- android中各种height和width总结
- img的width和height属性
- min-height和min-width的用法
- 获取View的height 和width
- div的width和height属性
- 获取View的height 和width
- 改变自定义Toast的width和height
- width和height解决全布局不会撑起来
- canvas标签的width和height以及style.width和style.height的区别
- canvas标签的width和height以及style.width和style.height的区别
- canvas标签的width和height以及style.width和style.height的区别
- 让IE6也支持max-width/height和min-width/height(完美解决方案)
- nginx配置ssl
- 联机分析处理简介
- iOS 仿百度外卖-个人中心(头像波浪效果)
- Hdu 2602 Bone Collector(简单01背包)
- ubuntu-16.04-desktop-i386安装lnmp环境
- Android weight布局均分和width(height)的一点关联
- eclipse报错: workspace in use or cannot be created, choose a different one.
- torch与anaconda冲突
- android——Bitmap.Config ARGB_8888
- 新建一个项目Spring MVC+maven 引入React前端框架
- extjs组件属性详解
- 199. Binary Tree Right Side View
- ubuntu16.04下的OpenStreetMap离线地理编码服务器的搭建(Nominatim)
- android 自定义轮播banner,包括手动轮播 CycleViewPager