I`m using Xamarin for Android. I know that i can assign an Id to the root layout and get it via this code :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/Root"
and in C# use :
var mLayout = (LinearLayout)FindViewById(Resource.Id.Root);
What i need is a method that could get the root layout without needing the ID. something like this:
var mLayout = GetRootLayout();
In your activity just call Window.DecorView.FindViewById (Android.Resource.Id.Content).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With