<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/top"
android:scaleType="centerCrop"
android:layout_weight="1"/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/bottom"
android:layout_weight="2" >
<ImageView
android:id="@+id/center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/in"/>
<ImageView
android:id="@+id/left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/center"
android:layout_toLeftOf="@id/center"
android:src="@drawable/help"
android:layout_centerVertical="true"/>
<ImageView
android:id="@+id/right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/center"
android:layout_toRightOf="@id/center"
android:src="@drawable/board"
android:layout_centerVertical="true"/>
<ImageView
android:id="@+id/top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/center"
android:layout_alignLeft="@id/center"
android:src="@drawable/setting"
android:layout_centerHorizontal="true"/>
<ImageView
android:id="@+id/bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/center"
android:src="@drawable/exit"
android:layout_alignLeft="@id/center"
/>
</RelativeLayout>
</LinearLayout>
是一个简单游戏开始界面,主要使用相对布局
本文详细介绍了如何设计并实现一个简单游戏的开始界面,利用Android的XML布局和相对布局来构建界面元素,并通过ImageView展示游戏相关的图片。界面包含顶部、底部、中间以及两侧的关键元素,实现了视觉上的统一和功能性。
1112

被折叠的 条评论
为什么被折叠?



