首页 > 移动平台 > 详细

android 布局文件 ScrollView 中的 listView item 显示不全解决方案

时间:2015-07-20 12:44:24      阅读:153      评论:0      收藏:0      [点我收藏+]
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 布局文件 ScrollView 中的 listView item 显示不全解决方案

原文:http://www.cnblogs.com/wanqieddy/p/4660820.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!