How to disable the views behind a view in Android? -
How to disable the views behind a view in Android? -
i have linearlayout listview this:
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> this linearlayout included in framelayout this:
<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> the textview "countdown" shown if need it. , wish can disable items in listview users can not click on them. tried in code is:
//disable other views behind, (int = 0; < programlistview.getchildcount(); i++) { view kid = programlistview.getchildat(i); child.setenabled(false); } but doesn't work correctly, can still click on items behind text view. should do?
1) create parameter in custom arrayadapter, exp boolean mislistenable = true;
2) override isenabled function:
@override public boolean isenabled(int position) { homecoming mislistenable; }
3) create setter parameter:
public void setenabled(boolean value){ mislistenable = value; } android android-layout listview view android-ui
Comments
Post a Comment