码迷,mamicode.com
首页 > 移动开发 > 详细

android绝对布局

时间:2015-08-27 00:00:18      阅读:501      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

 

绝对布局在游戏开发中常用,动态的计算出位置

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:layout_width="match_parent"
 4     android:layout_height="match_parent" >
 5 
 6     <Button
 7         android:id="@+id/button1"
 8         android:layout_width="wrap_content"
 9         android:layout_height="wrap_content"
10         android:layout_x="20dp"
11         android:layout_y="12dp"
12         android:text="Button" />
13 
14     <Button
15         android:id="@+id/button2"
16         android:layout_width="wrap_content"
17         android:layout_height="wrap_content"
18         android:layout_x="202dp"
19         android:layout_y="51dp"
20         android:text="Button" />
21 
22     <Button
23         android:id="@+id/button3"
24         android:layout_width="wrap_content"
25         android:layout_height="wrap_content"
26         android:layout_x="57dp"
27         android:layout_y="169dp"
28         android:text="Button" />
29 
30     <TimePicker
31         android:id="@+id/timePicker1"
32         android:layout_width="wrap_content"
33         android:layout_height="wrap_content"
34         android:layout_x="46dp"
35         android:layout_y="253dp" />
36 
37 </AbsoluteLayout>

 

android绝对布局

标签:

原文地址:http://www.cnblogs.com/danwuxinbolg/p/4761798.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!