listView 中relativeLayout 布局的 android:layout_alignParentBottom="true" 无效的解决办法
16lz
2021-01-23
首先高度要固定 listView item的布局中RelativeLayout的高度要是一个固定的值 如下 android:layout_height="?android:attr/listPreferredItemHeight"
其次:加载 layout文件 创建LayoutInflater对象的时候 要使用:
convertView = mInflater.inflate(R.layout.list_item_kind, parent, false); 而不能使用 convertView = mInflater.inflate(R.layout.list_item_kind, null); //error
把这俩问题解决了 就ok了
。 该bug在 android 2.2 以上的版本已经解决
+=======================================
相关链接:
http://www.isomobile.com/read.php?tid-462.html
http://code.google.com/p/android/issues/detail?id=1394
http://stackoverflow.com/questions/2520418/androidlayout-alignparentbottom-is-ignored-when-used-without-explicit-layout-hei#answer-2524471
更多相关文章
- android 界面布局
- 51. (android开发)线性布局、相对布局、帧布局
- 笔记 RelativeLayout:相对布局管理器:
- android Linearlayout中有关gravity与layout_gravity对布局的影
- Android 中的布局方式之线性布局
- android入门1:有关布局与activity数据传递等
- Android LinearLayout布局随心所欲
- Android 选择器 PickerView实例,时间选择器、地址选择器、单项选
- Android布局容器