2
的風格,我有這個XML改變編程我的RelativeLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/FragmentSecondary" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_alignParentTop="true"/>
<RelativeLyout>
我的風格是他的風格=「@風格/ FragmentSecondary」,要編程上改變它的風格= @風格/ FragmentTrains。 我不想重寫另一個xml。我需要把它寫在代碼中。我怎樣才能做到這一點?
可能重複:http://stackoverflow.com/questions/2016249/how-to-programmatically-setting-style-attribute-in-a-view – 2012-04-16 16:16:18