Ehs*_*adi 2 c# android android-activity xamarin
我正在使用Xamarin for Android。我知道我可以为根布局分配一个ID并通过以下代码获取它:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/Root"
Run Code Online (Sandbox Code Playgroud)
并在C#中使用:
var mLayout = (LinearLayout)FindViewById(Resource.Id.Root);
Run Code Online (Sandbox Code Playgroud)
我需要的是一种无需ID即可获取根布局的方法。像这样的东西:
var mLayout = GetRootLayout();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4611 次 |
| 最近记录: |