FrameLayout - um exemplo

Top  Previous  Next

Frame só abriga um único componente

Tela

 

Java

 

package com.laioutes;

 

import android.app.Activity;

import android.os.Bundle;

 

public class LayoutsActivity extends Activity {

  /** Called when the activity is first created. */

  @Override

  public void onCreate(Bundle savedInstanceState) {

      super.onCreate(savedInstanceState);

       setContentView(R.layout.frame);

   }

}

 

frame.xml

 

<?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"

  android:background="#98FB98" >

 

  <ImageView

      android:layout_width="wrap_content"

      android:layout_height="wrap_content"

      android:src="@drawable/smile" />

 

</FrameLayout>