Tuesday 4 June 2013

Overlay Text On Image or Other Layout in Android

 


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/overlay_margin"
        android:background="#FFF" >

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:src="@drawable/salogo" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/imageView1"
            android:layout_alignParentLeft="true"
            android:background="#7000"
            android:orientation="vertical"
            android:paddingTop="15dp" >

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:shadowColor="#000"
                android:shadowDx="3"
                android:shadowDy="3"
                android:shadowRadius="6"
                android:text="Styling Android"
                android:textColor="#FFF"
                android:textSize="36sp"
                android:textStyle="bold" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="A guide to applying styles and themes to Android apps"
                android:textColor="#CCC"
                android:textSize="12sp" />
        </LinearLayout>
    </RelativeLayout>

</LinearLayout>


1 comment:

  1. If you would like to learn how to use the following objects to write an Android application that displays a vertically upward scrolling Rainbow of colours in a FREE video, then click the link at the end of this comment:

    . LinearLayout
    . Activity
    . View
    . Canvas
    . Paint
    . ArrayList

    http://androidprogrammeringcorner.blogspot.com/2015/06/pak-longs-android-programming-corner_24.html

    ReplyDelete

Disqus for Android