更改主题,从按钮我有一个qutestion(pfff)我如何能在Android的
我有一个自定义主题启用和禁用状态的按钮。
<Button
android:id="@+id/btn_on_off"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="activar"
android:textColor="#ffffff"
android:textStyle="bold"
android:theme="@style/**MY_STYLE_A**" />
我想通过来源更改主题。 例如更改文本:myButton.setText("new text");
<Button
android:id="@+id/btn_on_off"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="activar"
android:textColor="#ffffff"
android:textStyle="bold"
android:theme="@style/**MY_STYLE_B**" />
我想,但我没有成功
你想改变风格或按钮颜色? –