Android 由于ViewPager,无法单击CardView
我在recyclerview中有CardView 如果viewpager具有适配器,则CardView不可剪裁。因此,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
<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" />