Created
March 5, 2014 20:13
-
-
Save benbishop/9375644 to your computer and use it in GitHub Desktop.
A C# Xamarin Class Extension for ViewGroup that lets you easily disable all contents of ViewGroup from touches.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Android.Views; | |
using Android.Widget; | |
namespace Rendr.Community | |
{ | |
public static class UIExtensions | |
{ | |
public static void SetChildrenEnabled (this ViewGroup group, bool enabled) | |
{ | |
for (int i = 0; i < group.ChildCount; i++) { | |
View view = group.GetChildAt (i); | |
view.Clickable = view.Enabled = enabled; | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment