Monodroid - 如何包含布局?
问题描述:
我正在查看android文档,如果我想使用include和merge。Monodroid - 如何包含布局?
于是我打开了Eclipse和得到它来提取一些代码,并在我的布局尚未作出这种
<include layout="@layout/progressbar" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
与
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<TextView android:text="Loading..." android:layout_height="wrap_content" android:layout_width="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:id="@+id/lblLoading" android:layout_marginLeft="180dp" android:layout_marginTop="240dp"></TextView>
<ProgressBar android:id="@+id/progBar" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_marginLeft="130dp" android:layout_marginTop="230dp"></ProgressBar>
</merge>
另一个文件,当我尝试做这在monodroid我得到错误,说它无法找到合并和包括。
答
您是否启用了“警告错误”?对于代码完成,Mono for Android包含一个用于.axml文件的XSD,并且XSD没有指定<include/>
或<merge/>
,因此Visual Studio在使用这些文件时会生成警告。 Mono for Android并不关心它们,并将它们传递给aapt。
如果你能提供确切的错误信息,这将是有用的。
答
尝试使用
<ProgressBar android:progress.....
并继续,它随着不同的选项乱搞的线条更。
+0
我认为进度条码有效。我想在多个领域使用相同的代码。但是它不会让我使用include来做到这一点。 – chobo2
您是否启用了“警告错误”?对于代码完成,Mono for Android包含一个用于.axml文件的XSD,并且XSD没有指定' '或' ',因此Visual Studio会在使用这些文件时生成警告。 Mono for Android并不关心它们,并将它们传递给'aapt'。 –
jonp