Android学习历程-FrameLayout帧布局
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <FrameLayout android:id="@+id/FrameLayout01" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="150px" android:height="150px" android:background="#aa0000"/> <TextView android:id="@+id/TextView02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="100px" android:height="100px" android:background="#00aa00"/> <TextView android:id="@+id/TextView03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="80px" android:height="80px" android:background="#0000aa" /> </FrameLayout> </FrameLayout>
package com.example.testcontextmenu.layout; import com.example.testcontextmenu.R; import android.app.Activity; import android.os.Bundle; public class TestFrameLayout extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.test_frame_layout); } }