Xamarin.android 为具有monodroid的编辑文本指定requestfocus标志?

Xamarin.android 为具有monodroid的编辑文本指定requestfocus标志?,xamarin.android,Xamarin.android,我试图通过布局文件设置文本编辑Request focus标志,如下所示: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android

我试图通过布局文件设置文本编辑Request focus标志,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <EditText
         android:id="@+id/etEditText1"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:ems="10">
         <requestfocus />
    </EditText>
</LienarLayout>
问题是VisualStudio抱怨我不能在那里使用。我怎样才能做到这一点


提前感谢。

这里有两件事需要注意:

VisualStudio在XML中显示警告并不意味着实际存在问题。为AXML文档提供的模式只是为了帮助提供基本的intellisense,但不是100%。在这种情况下,如果您编译并运行该应用程序,您会发现它实际上按照预期工作。 然而,您的XML存在一个实际问题。关闭LinearLayout标记拼写错误,这将触发生成错误。将其更新为将修复此问题。