aneela
aneela

Reputation: 1619

How to overlap an image with a textview

I want an image below an EditText so that it give me a look that I am actually writing on image. Forexample a cursor showing on the image.Can anybody help me?

Upvotes: 0

Views: 202

Answers (2)

Chinmoy Debnath
Chinmoy Debnath

Reputation: 2824

You can do as Android Killer told or you can use a relative layout then place a imageview and then place edittext before the imageview. Code will be like

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".EventActivity" >

    <ImageView 
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="#CCFFCC"/>
    <EditText
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="#00000000"
        />

</RelativeLayout>

Upvotes: 0

Android Killer
Android Killer

Reputation: 18489

First of all you can set an image as background of Edittext

secondly you can use frameLayout like this

<FrameLayout
    ...... 
    ...... >
<ImageView
    .....
    ....../>
<EditText
    ....
    ..../>
</FrameLayout>

Upvotes: 1

Related Questions