2

In android if I have a linear layout object, and it has a bunch of stuff inside it like textviews, more linear layouts which contain more linear layouts. How can you just disable (.setEnabled(false);) everything in that given linear layout?

Thanks

omega
  • 40,311
  • 81
  • 251
  • 474

2 Answers2

1

Something like that:

for(int i = 0; i < ((LinearLayout) YourLinearLayout).getChildCount(); i++){
  ((View)((LinearLayout) YourLinearLayout).getChildAt(i)).setEnabled(false);
}
Boris Mocialov
  • 3,439
  • 2
  • 28
  • 55
0

Check this:

How to disable/enable all children on LinearLayout in Android

Community
  • 1
  • 1
Hossam Oukli
  • 1,296
  • 3
  • 19
  • 42
  • But this removes the view from the screen, I want to use `.setEnabled(false)` method, so it makes it unusable and grayed out. – omega Aug 03 '13 at 21:01