У меня есть LinearLayout с ListView, как это:Как отключить представления позади представления в Android?
Training.XML
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<include layout="@layout/head_buttons"></include>
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/programmes" android:layout_gravity="bottom"/>
</LinearLayout>
Это LinearLayout входит в FrameLayout, как это:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<include layout="@layout/training_page"></include>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="60"
android:gravity="center"
android:alpha="0"
android:id="@+id/countdown" android:layout_gravity="center|center_vertical"
android:background="@drawable/circle_icon"
android:textColor="#ff000000" android:textSize="60dp"
android:layout_marginTop="30dp"
android:keepScreenOn="true"
/>
</FrameLayout>
«Обратный отсчет» TextView всегда будет отображаться, если мне это нужно , И теперь я хочу, чтобы я мог отключить все элементы в ListView, чтобы пользователи не могли на них нажимать. Я пытаюсь в коде:
//disable other views behind,
for (int i = 0; i < programListView.getChildCount(); i++) {
View child = programListView.getChildAt(i);
child.setEnabled(false);
}
Но это не работает правильно, я все еще могу щелкнуть по элементам, расположенным за текстовым видом. Что мне делать?
Привет @Rami Спасибо! Звучит неплохо! – Manuela
добро пожаловать @Manuela! – Rami