Текст поверх ImageView

Рейтинг: -1Ответов: 1Опубликовано: 23.04.2015

Пытаюсь разместить текст поверх картинки, но ничего не выходит. вот код

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
        android:background="@color/list_background"
        >
    <TextView android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/t_c"
              android:textColor="@color/text8"
              android:text="yyy"
              android:textSize="25dp"
              android:layout_alignParentTop="true" android:layout_alignRight="@+id/imageView3"/>
    <TextView android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/t_st"
              android:textColor="@color/name"
              android:textSize="25dp"
              android:text="rrrr"
              android:layout_marginLeft="5dp"
            />
    <TextView android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/h_o"
              android:textColor="@color/list_divider"
              android:text="rrrr"
              android:textSize="25dp"
              android:layout_alignParentTop="true" android:layout_centerHorizontal="true"/>
    <ImageView android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:background="@drawable/c_b"
               android:id="@+id/imageView3"
               android:layout_alignParentTop="true" android:layout_alignParentRight="true"/>
</RelativeLayout>

Ответы

▲ 4Принят

Если под "ничего не выходит" имеется в виду, что текст отображается под картинкой, а не над, то попробуйте переместить объявление ImageView в начало списка детей RelativeLayout. Таким образом ImageView должен быть в самом низу иерархии и все TextView должны будут отображаться поверх ImageView.