<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/flower" //設置背景圖片
tools:context="com.example.administrator.wuziqi.MainActivity"
android:id="@+id/jj">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" //縱向線性佈局
android:gravity="center"> //居中
<ImageButton
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/music"
android:id="@+id/music"
android:layout_gravity="right"
android:layout_marginRight="30dp" //右邊距
android:layout_marginBottom="30dp"/> //底邊距
<com.example.administrator.wuziqi.wuziqipan //自定義的view
android:layout_width="match_parent"
android:id="@+id/wuziqipan"
android:layout_height="match_parent"
android:layout_centerInParent="true"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" //水平線性佈局
android:gravity="center_horizontal" //水平居中
android:layout_marginTop="30dp">
<ImageButton
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@drawable/a3"
android:id="@+id/Huiqi"
/>
<ImageButton
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="100dp"
android:background="@drawable/a1"
android:id="@+id/Replay"
/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
Android-五子連珠(二)-佈局文件
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.