Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/221.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 垂直滚动ViewPager和Listview_Android - Fatal编程技术网

Android 垂直滚动ViewPager和Listview

Android 垂直滚动ViewPager和Listview,android,Android,我有水平视图页面和列表视图。当我滚动listview时,我也需要向上滚动viewpager,我已经从这个来源尝试过了 但是它不起作用 以下是我的看法: <?xml version="1.0" encoding="UTF-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://sche

我有水平视图页面和列表视图。当我滚动listview时,我也需要向上滚动viewpager,我已经从这个来源尝试过了 但是它不起作用

以下是我的看法:

 <?xml version="1.0" encoding="UTF-8"?>
            <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:id="@+id/content_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical" >

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="50dp"
                    android:background="#fff"
                    android:orientation="horizontal" >

                    <ImageButton
                        android:id="@+id/menuButton"
                        android:layout_width="50dp"
                        android:layout_height="50dp"
                        android:background="#fff"
                        android:contentDescription="@string/image"
                        android:scaleType="fitXY"
                        android:src="@drawable/menu" />

                    <ImageView
                        android:id="@+id/logo_okezone"
                        android:layout_width="200dp"
                        android:layout_height="50dp"
                        android:layout_centerHorizontal="true"
                        android:layout_centerInParent="true"
                        android:layout_toRightOf="@id/menuButton"
                        android:background="#fff"
                        android:contentDescription="@string/app_name"
                        android:src="@drawable/logo_okezone" />
                </RelativeLayout>

                <ScrollView
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:fillViewport="true" >

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="fill_parent"
                        android:orientation="vertical" >

                        <LinearLayout
                            android:id="@+id/first_color"
                            android:layout_width="fill_parent"
                            android:layout_height="8dip"
                            android:background="#0062a6"
                            android:orientation="horizontal" >
                        </LinearLayout>

                        <LinearLayout
                            android:id="@+id/second_color"
                            android:layout_width="fill_parent"
                            android:layout_height="35dip"
                            android:background="#03234c"
                            android:orientation="horizontal" >

                            <TextView
                                android:layout_width="100dip"
                                android:layout_height="wrap_content"
                                android:paddingBottom="5dip"
                                android:paddingLeft="5dip"
                                android:paddingTop="5dip"
                                android:text="@string/headline"
                                android:textColor="#fff"
                                android:textSize="16sp" />

                            <LinearLayout
                                android:layout_width="fill_parent"
                                android:layout_height="wrap_content"
                                android:gravity="right"
                                android:orientation="horizontal"
                                android:paddingBottom="5dip"
                                android:paddingRight="10dip"
                                android:paddingTop="5dip" >

                                <ImageView
                                    android:id="@+id/firstSlide"
                                    android:layout_width="20dip"
                                    android:layout_height="20dip"
                                    android:contentDescription="@string/image"
                                    android:paddingRight="10dip"
                                    android:src="@drawable/square_white" />

                                <ImageView
                                    android:id="@+id/secondSlide"
                                    android:layout_width="20dip"
                                    android:layout_height="20dip"
                                    android:contentDescription="@string/image"
                                    android:paddingRight="10dip"
                                    android:src="@drawable/square_gray" />

                                <ImageView
                                    android:id="@+id/thirdSlide"
                                    android:layout_width="20dip"
                                    android:layout_height="20dip"
                                    android:contentDescription="@string/image"
                                    android:paddingRight="10dip"
                                    android:src="@drawable/square_gray" />

                                <ImageView
                                    android:id="@+id/fourthSlide"
                                    android:layout_width="20dip"
                                    android:layout_height="20dip"
                                    android:contentDescription="@string/image"
                                    android:paddingRight="10dip"
                                    android:src="@drawable/square_gray" />
                            </LinearLayout>
                        </LinearLayout>

                        <android.support.v4.view.ViewPager
                            android:id="@+id/pager"
                            android:layout_width="match_parent"
                            android:layout_height="200dip" />

                        <LinearLayout
                            android:id="@+id/third_color"
                            android:layout_width="fill_parent"
                            android:layout_height="35dip"
                            android:background="#03234c"
                            android:orientation="horizontal" >

                            <TextView
                                android:layout_width="fill_parent"
                                android:layout_height="wrap_content"
                                android:paddingBottom="5dip"
                                android:paddingLeft="5dip"
                                android:paddingTop="5dip"
                                android:text="@string/terbaru"
                                android:textColor="#fff"
                                android:textSize="16sp" />
                        </LinearLayout>

                        <com.costum.android.widget.LoadMoreListView
                            android:id="@+id/list"
                            android:layout_width="fill_parent"
                            android:layout_height="fill_parent" />
                    </LinearLayout>
                </ScrollView>

            </LinearLayout>

请帮忙。
谢谢。

滚动视图中的Listview是一个非常糟糕的主意。