lxmlを使用して、Androidxmlファイルのいくつかの属性値を変更したいと思います。
例えば:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/version_label"
android:layout_marginLeft="5sp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="version"/>
</LinearLayout>
「android:text」の値を変更したいのですが、
textViewTagNode.attrib['android:text'] = "new value"
うまくいかなかった、どちらも
textViewTagNode.set('android:text', 'new value')
動作する可能性があります。私が得るのは「無効な属性名u'android:text'」だけです
名前空間の問題であることは知っていますが、修正方法がわかりません。
どうもありがとう。