首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

listView 中relativeLayout 布局的 android:layout_alignParentBottom="true" 无

2012-07-04 
listView 中relativeLayout 布局的 android:layout_alignParentBottomtrue 无效的解决办法?view plain

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

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

热点排行