Code: Color Reference Code <relativelayout 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" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" Tools:context=". Mainactivity " android:background="@color/bgroud" > <textview Android:layout_width="Wrap_content" android:layout_height="Wrap_content" android:text="@string/hello_world" android:textcolor="@color/red_bg" android:textsize="30SP" /> </RelativeLayout> String Reference Code <relativelayout 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" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" Tools:context=". Mainactivity " android:background="@drawable/ic_launcher" > <linearlayout android:id="@+id/linearlaout1" Android:layout_width="350DP" android:layout_height="Wrap_content" android:orientation="vertical"> <textview Android:layout_width="Wrap_content" android:layout_height="Wrap_content" android:text="@string/hello_world" android:id="@+id/texview1" android:layout_gravity="center" android:textsize="20SP" /> </LinearLayout> <button android:id="@+id/button1" Android:layout_width="Wrap_content" android:layout_height="Wrap_content" android:layout_below="@+id/linearlaout1" Android:layout_centerhorizontal="true" android:text="@string/btn" /> </RelativeLayout> Run Result: () |