开发者

Monodroid - How to include layouts?

开发者 https://www.devze.com 2023-03-27 01:14 出处:网络
I am looking at android documentation and if I want to use include and merge. So I opened up eclipse and got it to extract some of the code out and it made in my layout this

I am looking at android documentation and if I want to use include and merge.

So I opened up eclipse and got it to extract some of the code out and it made in my layout this

 <include layout="@layout/progressbar"  android:layout_width="wrap_content" android:layout_height="wrap_content"/>

and another file with

<?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开发者_JAVA技巧_height="wrap_content" android:layout_width="wrap_content" android:layout_marginLeft="130dp" android:layout_marginTop="230dp"></ProgressBar>
</merge>

Yet when I try to do this in monodroid I get errors saying it can't find merge and include.


Do you have "warnings as errors" enabled? For code completion, Mono for Android includes an XSD for .axml files, and the XSD doesn't specify <include/> or <merge/>, and thus Visual Studio will generate a warning when those are used. Mono for Android doesn't care about them, though, and passes them through to aapt.

It would be useful if you could provide the exact error message.


try using

<ProgressBar android:progress.....

And continue, its more along the lines of messing around with different options.

0

精彩评论

暂无评论...
验证码 换一张
取 消