編程時是否可以通過編程實現特定佈局的所有子項?如何在Android中禁用/啓用LinearLayout上的所有孩子
,比如我有這樣的佈局有兩個孩子:
<LinearLayout android:layout_height="wrap_content"
android:id="@+id/linearLayout1" android:layout_width="fill_parent">
<SeekBar android:layout_height="wrap_content" android:id="@+id/seekBar1"
android:layout_weight="1" android:layout_width="fill_parent"></SeekBar>
<TextView android:id="@+id/textView2" android:text="TextView"
android:layout_width="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_height="wrap_content"></TextView>
</LinearLayout>
,我想這樣做:
LinearLayout myLayout = (LinearLayout) findViewById(R.id.linearLayout1);
myLayout.setEnabled(false);
爲了禁用這兩個textviews。
任何想法如何?
沒有使用setVisibility(View.GONE),可以在Android的LinearLayout上禁用/啓用所有的孩子 –
我該如何做嵌套的Layout @ SBerg413 – Prabs