views:

28

answers:

1

how to add edit text view on image on android

A: 

Not sure if this is what your are looking for, but perhaps this might help you get started.

If you have multiple images like that, I suspect you will have to replicate the following code many times. Again, because the question in itself is not clear, not sure if this is the best solution to the problem.

<LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" 
        android:gravity="center"
        android:padding="5dip"    >
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingLeft="6dip"
            android:paddingRight="6dip"
            android:paddingBottom="6dip"
            android:background="@drawable/quoteonthego_header"    >
        </ImageView>
        <EditText
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:hint="Some random text"
            android:gravity="center"    >
        </EditText>
   </LinearLayout>

If, however, you want the EditText "on" the "image" then, this ought to work for you:

<LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal" 
        android:padding="5dip"
        android:background="@drawable/someimagename"
        android:gravity="bottom"    >
        <EditText
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:hint="Some random text"    >
        </EditText>
   </LinearLayout>
Siddharth Lele