1
我有以下的自定義的GridView:CardView裏面的GridView與點擊效果
<android.support.v7.widget.CardView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
app:cardCornerRadius="2dp"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="5dp">
<ImageView
android:id="@+id/grid_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_weight="4"/>
<TextView
android:id="@+id/grid_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
</android.support.v7.widget.CardView>
現在我有CardView風格的GridView,但是當我點擊任何一個項目有沒有點擊效果(我想有cicle點擊效果的android 5.0或至少任何點擊效果!),我真的不知道如何archieve這一點。任何幫助,將不勝感激!
乾杯。