android:textColor="#โค้ดสี"
ตัวอย่าโค้ด
โค้ด: เลือกทั้งหมด
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.worachat.radiobutton.MainActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hello World"
android:textSize="50dp"
android:textColor="#9ACD32"/></LinearLayout>
ตัวอย่าโค้ด
โค้ด: เลือกทั้งหมด
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="YellowGreen">#9ACD32</color>
</resources>
android:background="@color/YellowGreen"
ตัวอย่าโค้ด
โค้ด: เลือกทั้งหมด
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.worachat.radiobutton.MainActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hello World"
android:textSize="50dp"
android:textcolor="@color/YellowGreen"/></LinearLayout>