Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android textview over imageview with background transparent

Please let me know how to add textview over imageview with background transparent as per image. Detail is I want to add two textview over imageview, one textview is title and the rest one is description. And background is transparent. Please help.enter image description here

like image 276
PPShein Avatar asked Dec 16 '22 06:12

PPShein


2 Answers

I think you should use merge tag in xml of your layout.. For example Merge example

like image 199
rdbmsa Avatar answered Feb 22 '23 22:02

rdbmsa


one possible way: add Framelayout as root and then add textview and imageview like this

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<ImageView  
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 

    android:scaleType="center"
    android:src="@drawable/golden_gate" />

<TextView
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_marginBottom="20dip"
    android:layout_gravity="center_horizontal|bottom"

    android:padding="12dip"

    android:background="#AA000000"
    android:textColor="#ffffffff"

    android:text="Golden Gate" />

 </FrameLayout>
like image 31
Milon Avatar answered Feb 22 '23 22:02

Milon