Android HorizontalScrollView嵌套HorizontalScrollView
我想要一个包含水平滚动视图的水平滚动视图 这是我当前的布局:Android HorizontalScrollView嵌套HorizontalScrollView,android,android-layout,android-scrollview,Android,Android Layout,Android Scrollview,我想要一个包含水平滚动视图的水平滚动视图 这是我当前的布局: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/activity_main" xmlns:android="http://schemas.android.com/apk/res/android"
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.erik.playground.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"/>
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:clipChildren="false"
android:nestedScrollingEnabled="true"
android:layout_marginTop="40dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_height="20dp"
app:cardElevation="9dp"
android:layout_width="500dp"/>
<HorizontalScrollView
android:layout_width="100dp"
android:layout_height="match_parent"
android:layout_marginTop="10dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<android.support.v7.widget.CardView
android:layout_height="20dp"
app:cardElevation="9dp"
android:layout_width="600dp"/>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
</HorizontalScrollView>
</RelativeLayout>
现在,内部水平滚动视图不滚动,只有外部滚动
有可能做到这一点吗?为什么?你能简单地把多个视图放在你的水平滚动视图中吗?最后,外部视图将被分页,而内部视图是一个页面的内容。我知道你可以使用一个寻呼机,但我想把它移植到本地,这样不用寻呼机就更容易了。你有没有想过一个简单的水平滚动的RecyclerView?因为你需要一个适配器,一切都变得复杂了。你找到解决问题的方法了吗?为什么?你能简单地把多个视图放在你的水平滚动视图中吗?最后,外部视图将被分页,而内部视图是一个页面的内容。我知道你可以使用一个寻呼机,但我想把它移植到本地,这样不用寻呼机就更容易了。你有没有想过一个简单的水平滚动的RecyclerView?因为你需要一个适配器,一切都变得复杂了。你找到解决问题的方法了吗?