---
title: "绝对布局 AbsoluteLayout  "
author: "AndLi"
date: "2011-10-11T07:12:10Z"
tags: []
categories: ["移动开发"]
slug: "absolutelayout"
draft: false
lastmod: "2011-10-11T00:16:47Z"
id: 1189175
url: "https://andli.iteye.com/blog/1189175"
---

```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:orientation="vertical" android:layout_width="fill_parent"
	android:layout_height="fill_parent">
<AbsoluteLayout 
	android:id="@+id/AbsoluteLayout01" 
	android:layout_width="wrap_content" 
	android:layout_height="wrap_content">

	<Button 
	android:text="A" 
	android:id="@+id/Button01" 
	android:layout_width="wrap_content" 
	android:layout_height="wrap_content"
	android:layout_x="20px"
	android:layout_y="20px"
	></Button>
	
	<Button 
	android:text="B" 
	android:id="@+id/Button02" 
	android:layout_width="wrap_content" 
	android:layout_height="wrap_content"
	android:layout_x="60px"
	android:layout_y="20px"
	></Button>
	
	<Button 
	android:text="C" 
	android:id="@+id/Button03" 
	android:layout_width="wrap_content" 
	android:layout_height="wrap_content"
	android:layout_x="20px"
	android:layout_y="80px"
	></Button>
	
	<Button 
	android:text="D" 
	android:id="@+id/Button04" 
	android:layout_width="wrap_content" 
	android:layout_height="wrap_content"
	android:layout_x="60px"
	android:layout_y="80px"
	></Button>
	
	
	
</AbsoluteLayout>


</LinearLayout>
```

   
![](http://dl.iteye.com/upload/attachment/567542/1acd2f98-e410-3ecc-9a9c-aa9dd1099192.png)  ![](http://dl.iteye.com/upload/attachment/567547/68a0428e-fd03-3626-8351-d5f742447c9e.png)