FrameLayout

FrameLayout

/res/layout/main.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_width="match_parent" android:id="@+id/frameLayout1"
	android:layout_height="wrap_content" android:layout_gravity="center">
	<ImageView android:layout_height="wrap_content" android:src="@drawable/rect"
		android:layout_width="wrap_content" android:id="@+id/imageView1"
		android:minHeight="200px" android:minWidth="200px"></ImageView>
	<ImageView android:layout_height="wrap_content" android:src="@drawable/cir"
		android:layout_width="wrap_content" android:id="@+id/imageView2"
		android:minHeight="100px" android:minWidth="100px"></ImageView>
	<TextView android:layout_width="wrap_content"
		android:layout_height="wrap_content" android:text="hello" />
</FrameLayout>

Activity file

package com.androidwork.framelayoutdemo;

import android.app.Activity;
import android.os.Bundle;

public class FrameLayoutDemoActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}

/res/drawable/cir.png
/res/drawable/rect.png
Output

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s