0

ラジオボタンのテキストの色を変更できません:

  <RadioGroup
                        android:gravity="center"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal"
                        android:color = "#000000"
                    >

                        <RadioButton 
                            android:id="@+id/contact_yes"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:color = "#000000"
                            android:text="@string/yes" />

                        <RadioButton 
                            android:id="@+id/contact_no"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:color = "#000000"
                            android:text="@string/no" />
                </RadioGroup>

いつも白だし、黒に変えたいのですが?

前もって感謝します

4

4 に答える 4

1

属性はtextColor="#ffff00ff" 例えば

于 2012-06-05T10:21:27.780 に答える
1
android:textColor="#000000"

また

android:textColor="@android:color/black"

textColor テキストの色を変更するために使用します

<RadioButton android:id="@+id/contact_yes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:color = "#000000"
android:text="@string/yes" />
于 2012-06-05T10:21:48.203 に答える
1

これを試して:

<RadioButton 
android:id="@+id/contact_yes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:text="@string/yes" />
于 2012-06-05T10:22:49.233 に答える
0

android:textColor メソッドを使用してそれを行うことができます。

例は android:textColor="#00000000" です

#00000000 では、左 2 ビットが透過ビットです。#00 (透明) 00 () 00 () 00 ()。それらは16進数です。

透明ビットの詳細については、「透明な背景を設定する」を参照してください。

于 2015-12-19T13:16:55.630 に答える