#android #listview #view #touch #onclicklistener
#Android #просмотр списка #Вид #коснитесь #onclicklistener
Вопрос:
У меня есть listview
с header
этим header
transparent
, под его заголовком есть представление, которое я хочу щелкнуть по нему, прежде listview
чем элементы перейдут к нему с помощью прокрутки.
Я ищу некоторые решения, такие как: use cancelable
или focusable
свойство заголовка и устанавливаю для этих значений значение false; Но проблема все еще жива!
Как получить доступ к прослушивателю onclick для просмотра, который находится в другом представлении, в этой особой ситуации?
Я хочу нажать на orderTypeLinearLayout
<RelativeLayout 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:background="@color/lightestGray"
android:orientation="vertical">
<LinearLayout
android:id="@ id/rootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray"
android:orientation="vertical">
<LinearLayout
android:id="@ id/headerLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.6"
android:background="@color/gray"
android:orientation="vertical"
android:padding="10dp">
<ImageView
android:id="@ id/titleImageView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scaleType="centerInside"
tools:ignore="ContentDescription,NestedWeights" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:orientation="horizontal">
<LinearLayout
android:id="@ id/orderTypeLinearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_arrow_drop_down_white"
tools:ignore="ContentDescription,RtlHardcoded" />
<TextView
android:id="@ id/orderTypeTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:gravity="left"
android:textColor="@color/white"
android:textSize="16sp"
tools:ignore="RtlHardcoded" />
</LinearLayout>
<TextView
android:id="@ id/userListTitleTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:gravity="right"
android:textColor="@color/white"
android:textSize="16sp"
tools:ignore="RtlHardcoded" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.4"
android:background="@color/gray" />
</LinearLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@ id/scoreBoardSwipeRefresh"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ListView
android:id="@ id/scoreBoardFragmentListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="1"
android:divider="@null" />
</android.support.v4.widget.SwipeRefreshLayout>
Комментарии:
1. опубликуйте свой XML-файл, пожалуйста!
2. @HyperMax1991 добавлен xml