您的位置:首页 > 移动开发 > Android开发

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"               />
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: