您好,欢迎访问四川文乐途图包装有限公司!

全国咨询热线

18980820575
✕

营山网站设计公司,营山网页设计,营山网站维护,营山网站优化,seo优化,,营山网站建设,营山网站公司

Android实现疯狂连连看游戏之开发游戏界面(二)-创新互联

连连看的游戏界面十分简单,大致可以分为两个区域:
--游戏主界面区
--控制按钮和数据显示区

创新互联建站从2013年开始,是专业互联网技术服务公司,拥有项目网站设计制作、成都网站设计网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元高密做网站,已为上家服务,为高密各地企业和个人服务,联系电话:18982081108

1、开发界面布局


本程序使用一个RelativeLayout作为整体的界面布局元素,界面布局上面是一个自定义组件,下面是一个水平排列的LinearLayout。

下面是本程序的布局文件:/res/layout/main.xml


<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
 android:layout_width="fill_parent" android:layout_height="fill_parent" 
 android:background="@drawable/room"> 
 <!-- 游戏主界面的自定义组件 --> 
 <cn.oyp.link.view.GameView 
 android:id="@+id/gameView" android:layout_width="fill_parent" 
 android:layout_height="fill_parent" /> 
 <!-- 水平排列的LinearLayout --> 
 <LinearLayout android:layout_width="fill_parent" 
 android:layout_height="fill_parent" android:orientation="horizontal" 
 android:layout_marginTop="380px" android:background="#1e72bb" 
 android:gravity="center"> 
 <!-- 控制游戏开始的按钮,该按钮的背景图片可以根据按钮的状态改变 --> 
 <Button android:id="@+id/startButton" android:layout_width="wrap_content" 
 android:layout_height="wrap_content" android:background="@drawable/button_selector" /> 
 <!-- 显示游戏剩余时间的文本框 --> 
 <TextView android:id="@+id/timeText" android:layout_width="wrap_content" 
 android:layout_height="wrap_content" android:gravity="center" 
 android:textSize="20dip" android:width="150px" android:textColor="#ff9" /> 
 </LinearLayout> 
</RelativeLayout> 
友情链接 :