1.猜拳小游戏的布局
strings.xml
<resources>
<string name="app_name">猜拳小游戏</string>
<string name="finger_choice">请您选择要出的拳</string>
<string name="stone">石头</string>
<string name="scissors">剪刀</string>
<string name="cloth">布</string>
<string name="clickbutton">出拳</string>
<string name="menu_settings">Settings</string>
<string name="title_activity_main">MainActivity</string>
</resources>
activity_main.xml
<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" >
<TextView
android:id="@+id/finger_chioce"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:padding="@dimen/padding_medium"
android:text="@string/finger_choice"
tools:context=".MainActivity" />
<RadioButton
android:id="@+id/stone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/finger_chioce"
android:text="@string/stone" />
<RadioButton
android:id="@+id/scissors"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/finger_chioce"
android:layout_toRightOf="@+id/stone"
android:text="@string/scissors" />
<RadioButton
android:id="@+id/cloth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/scissors"
android:layout_toRightOf="@+id/scissors"
android:text="@string/cloth" />
<Button
android:id="@+id/click"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/stone"
android:layout_marginTop="17dp"
android:layout_toLeftOf="@+id/scissors"
android:text="@string/clickbutton" />
</RelativeLayout>
2.效果图