【发布时间】:2012-04-10 15:51:08
【问题描述】:
我想从另一个 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>
两个.xml如下:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="linearLayout1" value="8" />
<int name="linearLayout2" value="0" />
</map>
从上面的两个 xml 文件中,我想更改属性值之一。 xml 什么时候 如果
<int name ="linearLayout1" value = "8"/>
从 two.xml 然后我想将 one.xml 文件更新为 LinearLayout android:id="@+id/linearLayout1" 然后将属性值更改为 android:visibility="gone"。
【问题讨论】:
-
"如果**from **two.xml 时更改属性值一.xml",更多解释。
-
我想更新 one.xml 文件
-
如果是windows,你的平台是什么,使用“\\”来读取文件
-
发生了什么,代码不是你想要的?
标签: java android xml updatexml