layout_alignParentBottom android 无效

场景:listView 中relativeLayout 布局的 android:layout_alignParentBottom="true&quot

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 以上的版本已经解决

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