android 布局文件 ScrollView 中的 listView item 显示不全解决方案
2015-07-20 10:51
615 查看
import android.content.Context; import android.util.AttributeSet; import android.widget.ListView; /** * Created by wanqi on 15-7-20. */ public class ScrollListView extends ListView { public ScrollListView(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { //根据模式计算每个child的高度和宽度 int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, expandSpec); } }
在xml文件中应用 ;
<com.cs.ronghui.list.MyListView android:id="@+id/procutsugID" android:layout_width="fill_parent" android:layout_height="wrap_content" />
相关文章推荐
- Android SwipeRefreshLayout:谷歌官方SDK包中的下拉刷新
- android 常见分辨率(mdpi、hdpi 、xhdpi、xxhdpi )及屏幕适配注意事项
- Android应用安全之运行环境检查
- Android 和php 短接base64 乱码问题
- Android改变状态栏颜色导航不变
- Android surfaceView(一)
- Android多种方式实现自定义Dialog对话框
- 使用命令启动android sdk manager
- Android ProgressDialog工具类
- android Shader绘图探究
- Android开发四大组件---Service详解
- Android安全--运行时验证签名
- Android学习之模拟器上面应用的sdcard的创建使用
- Android中新建的文件在R没有显示对应的文件解决办法总结
- 安卓自定义组合控件 android.view.InflateException: Binary XML file #23:error inflate
- android stdio出现的 问题
- 自定义View(三)Android圆环两个颜色交替出现的等待效果
- Android Studio中安装Genymotion插件解决方案
- Android Service 之三(Bind Service, 继承自 Binder 类)
- Android -- DiskLruCache