Android 开发实例篇(1)-----简易涂鸦板
一、概述
这次要做一个简单的涂鸦板应用,以前在 Qt 上实现过,突然
想到要把它在 Android 上实现,呵呵,既简单又有趣。
二、实现
新建工程 MyWall,修改/res/layout/main.xml 文件,在里面
添加一个 SurfaceView 和两个 Button,用到了 RelativeLayout
布局,完整的 main.xml 文件如下:
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
4 android:layout_width="fill_parent"
5 android:layout_height="fill_parent"
6 android:orientation="vertical"
7 >
8
9 <SurfaceView
10 android:id="@+id/surfaceview"
11 android:layout_width="fill_parent"
12 android:layout_height="wrap_content"
13 android:layout_above="@+id/line"
14 android:layout_alignParentTop="true"
15 />
16
17 <LinearLayout
18 android:id="@+id/line"
19 android:layout_width="fill_parent"
20 android:layout_height="wrap_content"
21 android:layout_alignParentBottom="true"
22 >
评论0