Activity布局文件
android:orientation="vertical"
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:layout_height="wrap_content"
android:orientation="horizontal"
>
android:layout_height="wrap_content"
android:text="@string/search"
/>
android:layout_height="wrap_content"
android:text="@string/edit"
/>
android:layout_height="wrap_content"
android:text="@string/help"
/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:inputType="number"
android:background="@android:drawable/edit_text"
>
android:layout_height="wrap_content"
android:orientation="vertical"
>
android:layout_height="wrap_content"
android:orientation="horizontal"
>
android:layout_height="wrap_content"
android:orientation="horizontal"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/f"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/g"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/h" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/i"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/j"
/>
android:layout_height="wrap_content"
android:orientation="horizontal"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/seven"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/eight"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/nine"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sub"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/yu"
/>
android:layout_height="wrap_content"
android:orientation="horizontal"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/four"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/five"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/six"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/plus"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/con"
/>
android:layout_height="wrap_content"
android:orientation="horizontal"
>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
android:layout_height="wrap_content"
android:orientation="horizontal"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/one"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/two"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/three"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/jian"
/>
android:layout_height="wrap_content"
android:orientation="horizontal"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/zero"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dian"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/add"
/>
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="@string/equal"
/>
String资源文件
然后运行后的效果图是这样的