我已经在Visual Studio中使用NuGet添加了Xamarin Android支持设计库(及其所有依赖项),但是当我在我的AXML代码中使用组件时,它说它是无效的子元素。从我能找到的所有文档和示例中,除了通过NuGet添加软件包外,似乎没有其他任何额外的需要。我可以在解决方案资源管理器的“参考”文件夹中看到所有库。Xamarin Android支持设计库不可用
我敢肯定我错过了一件非常简单的事情,但我找不到什么不对。任何帮助,将不胜感激。谢谢!
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:p1="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
p1:orientation="vertical"
p1:layout_width="match_parent"
p1:layout_height="match_parent">
<ImageView
p1:src="@drawable/boxlogo"
p1:layout_width="match_parent"
p1:layout_height="wrap_content"
p1:id="@+id/boxLogo" />
<android.support.design.widget.TextInputLayout
p1:layout_width="match_parent"
p1:layout_height="wrap_content">
<EditText
p1:layout_width="match_parent"
p1:layout_height="wrap_content"
p1:id="@+id/sku"
p1:hint="@string/sku" />
</android.support.design.widget.TextInputLayout>
...
</LinearLayout>
我得到android.support.design.widget.TextInputLayout
我能够访问我的C#代码库标签上的错误。
什么错误?可能你应该使用[TextInputEditText](https://developer.android.com/reference/android/support/design/widget/TextInputEditText.html)而不是EditText? –
“元素'LinearLayout'具有无效的子元素'android.support.design.widget.TextInputLayout'”是我得到的错误,我认为这是Alex得到的错误。 Xamarin博客给出了'EditText'的示例(https://blog.xamarin.com/add-beautiful-material-design-with-the-android-support-design-library/),但即使在使用'android.support .design.widget.TextInputEditText'不起作用。 –