-7

How can insert a TextView within an image like the one in the photo. enter image description here

1 Answers1

0

You could try FrameLayout defined like this:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/white"
android:orientation="vertical">


    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="200dp"
        android:contentDescription="@string/some_pic_desc"
        android:src="@drawable/some_pic" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dp"
        android:layout_marginTop="175dp"
        android:background="@color/wallet_link_text_light"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        android:text="TOP STORIES"
        android:textColor="@android:color/white"
        android:textSize="30dp" />

</FrameLayout>

Where resources should be defined. I have ommited the bottom menu and rounded corners since the question was not about this but you may try read

Kamil Leis
  • 119
  • 7