0
最初に私はをCardView
の中に持っています。 GridView
はデータを表示するためのものです。アイテムはクリックできません。それぞれのCardView
にはクリックイベントがあり、詳細Activity
に移動します。GridViewのアイテムを完全に無効にする
私の問題は、ユーザーがGridView
をクリックすると、詳細Activity
には行きません。
マイCardView
コード:
<android.support.v7.widget.CardView
android:id="@+id/card_view_geo"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_vertical_margin"
android:layout_marginRight="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/horizontal_space_medium"
android:layout_marginBottom="@dimen/horizontal_space_small"
android:background="?attr/selectableItemBackground"
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:layout_gravity="center"
cardUseCompatPadding="true"
cardElevation="3dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/vertical_space_small"
android:paddingBottom="@dimen/vertical_space_medium"
android:paddingLeft="@dimen/horizontal_space_medium"
android:paddingRight="@dimen/horizontal_space_medium"
android:orientation="vertical">
<TextView
android:id="@+id/text_geo_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/vertical_space_small"
android:singleLine="true"
android:textSize="@dimen/title_text_size"
android:text="My Geo"/>
<br.com.hbsis.indicadores.util.view.WrapContentGridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/grid_view_indicators"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnWidth="@dimen/grid_view_column_width"
android:numColumns="auto_fit"
android:verticalSpacing="@dimen/grid_view_spacing"
android:horizontalSpacing="@dimen/grid_view_spacing"
android:stretchMode="columnWidth"
android:gravity="center"/>
</LinearLayout>
事前
投稿してくださいいくつかのコード –
アンドロイド:クリッカブル=「false」にGridViewの – Robbert
おかげ@Robbertにこれを追加しようとするが、それは動作しません。 私もこの事を試してみた: アンドロイド:クリッカブル= "false" を アンドロイド:フォーカス可能= "false" を アンドロイド:touchscreenBlocksFocus = "true" を アンドロイド:focusableInTouchMode = "false" を –