Thursday, December 08, 2011
Frame Layout in Android :
# We have to create a frame layout and display an image within it.
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="240px"
android:layout_y="320px" >
<ImageView
android:src="@drawable/myphoto"
android:id="@+id/myphoto"
android:layout_width="320px"
android:layout_height="480px"
android:scaleType="fitCenter"
android:background="#000000"/>
</FrameLayout>
</LinearLayout>
Output :
# We have to create a frame layout and display an image within it.
- Create a xml file named as "frame_image.xml".
- Pick an image file and paste it in res/drawable.
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="240px"
android:layout_y="320px" >
<ImageView
android:src="@drawable/myphoto"
android:id="@+id/myphoto"
android:layout_width="320px"
android:layout_height="480px"
android:scaleType="fitCenter"
android:background="#000000"/>
</FrameLayout>
</LinearLayout>
Output :

Author: Mohammad
Mohammad is the founder of STC Network which offers Web Services and Online Business Solutions to clients around the globe. Read More →
Related Posts:
Subscribe to:
Post Comments (Atom)
0 comments: