私はこのような形状属性を使用しています:
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:padding="10dp">
<solid
android:color="#FFFFFF" />
<corners
android:bottomRightRadius="15dp"
android:bottomLeftRadius="15dp"
android:topLeftRadius="15dp"
android:topRightRadius="15dp" />
</shape>
と
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/rounded_textview">
</TextView>
次の方法で実行時に色を変更すると:
TextView.setBackgroundColor();
使っていた形が消えます。適切な方法で変更するにはどうすればよいですか?それとも、色が異なるだけで多くの形状を生成する必要がありますか?
ありがとう。