Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/207.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,无法单击CardView_Android_Android Viewpager_Android Cardview - Fatal编程技术网

Android 由于ViewPager,无法单击CardView

Android 由于ViewPager,无法单击CardView,android,android-viewpager,android-cardview,Android,Android Viewpager,Android Cardview,我在recyclerview中有CardView 如果viewpager具有适配器,则CardView不可剪裁。因此,viewpager中的项目将超过cardview。如何解决这个问题 我的名片视图: <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-a

我在recyclerview中有CardView

如果viewpager具有适配器,则CardView不可剪裁。因此,viewpager中的项目将超过cardview。如何解决这个问题

我的名片视图:

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/card"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clickable="true"
    android:foreground="?android:attr/selectableItemBackground"
    app:cardCornerRadius="2dp"
    app:cardElevation="2dp">

    <android.support.percent.PercentFrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <android.support.v4.view.ViewPager
            android:id="@+id/view_pager"
            app:layout_aspectRatio="150%"
            app:layout_widthPercent="100%" />

    </android.support.percent.PercentFrameLayout>

</android.support.v7.widget.CardView>

ViewPager中的我的项目:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
    android:id="@+id/photo"
    android:scaleType="centerCrop"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

<ProgressBar
    android:id="@+id/progress_bar"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center" />