listView 中relativeLayout 布局的 android layout alignParentBotto

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

               

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

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

  1. convertView = mInflater.inflate(R.layout.list_item_kind, parent, false);  
  2.   
  3. 不能使用   
  4. convertView = mInflater.inflate(R.layout.list_item_kind, null); //error  
 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

           

给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow

这里写图片描述

猜你喜欢

转载自blog.csdn.net/gruhgd/article/details/83896004