/******************布局**********************/
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".activities.GoodsActivity">
<com.handmark.pulltorefresh.library.PullToRefreshScrollView
android:id="@+id/pull_to_refresh_scrollview"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="240dp">
<android.support.v4.view.ViewPager
android:id="@+id/goods_viewpager"
android:layout_width="match_parent"
android:layout_height="240dp"></android.support.v4.view.ViewPager>
<LinearLayout
android:id="@+id/ll_points"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:background="#0f0"
android:gravity="center"
android:orientation="horizontal"></LinearLayout>
</RelativeLayout>
<com.daydayup.yuekao_moth4.MyListView
android:id="@+id/goods_listview"
android:layout_width="match_parent"
android:layout_height="wrap_content"></com.daydayup.yuekao_moth4.MyListView>
</LinearLayout>
</com.handmark.pulltorefresh.library.PullToRefreshScrollView>
</LinearLayout>
/*********mylistview自定义布局解决只显示一行*************/
public class MyListView extends ListView {
public MyListView(Context context) {
super(context);
}
public MyListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyListView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int heigtSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, heigtSpec);
}
}