当前位置: 代码迷 >> Android >> listView 中relativeLayout 布局的 android:layout_alignParentBottom="true" 无效的解决方法
  详细解决方案

listView 中relativeLayout 布局的 android:layout_alignParentBottom="true" 无效的解决方法

热度:98   发布时间:2016-05-01 19:17:02.0
listView 中relativeLayout 布局的 android:layout_alignParentBottom="true" 无效的解决办法

?

view plain
  1. 首先高度要固定??
  2. ??
  3. listView?item的布局中RelativeLayout的高度要是一个固定的值??
  4. 如下??
  5. android:layout_height="?android:attr/listPreferredItemHeight"??

?

?

其次:加载 layout文件 创建LayoutInflater对象的时候 要使用:

?

?

view plain
  1. convertView?=?mInflater.inflate(R.layout.list_item_kind,?parent,?false);??
  2. ??
  3. 不能使用???
  4. convertView?=?mInflater.inflate(R.layout.list_item_kind,?null);?//error??

?

?

把这俩问题解决了 就ok了

?

。 该bug在 android 2.2 以上的版本已经解决

+=======================================

  相关解决方案