我想更新从另一个XML file.I XML文件已使用的XML文件,如下所示:如何动态更新另一个xml文件的xml文件?
one.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="#00BFFF">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:gravity="center" android:visibility="visible">
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:gravity="center" android:visibility="visible">
</LinearLayout>
</LinearLayout>
</ScrollView>
two.xml如下:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="linearLayout1" value="8" />
<int name="linearLayout2" value="0" />
</map>
从上面的两个xml文件我想更改属性值之一。当 如果
<int name ="linearLayout1" value = "8"/>
从two.xml XML那么我想更新one.xml文件作为其中的LinearLayout 机器人:ID = “@ + ID/linearLayout1”然后更改属性值as android:visibility =“gone”。
“改变属性值之一。 xml when if ** from ** two.xml“,解释一下更多。 – 2012-03-27 06:04:10
编辑内容 – 2012-03-27 06:08:57
我想获得更新one.xml文件 – 2012-03-27 06:09:42