Answer the question
In order to leave comments, you need to log in
Positioning elements relative to each other in android
Hello. I've been struggling for an hour with placing an inscription (TextView) under the picture (ImageView). As far as I understand, there is a layout_below for this, but for some reason it does not work. Please help.
<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"
android:orientation="horizontal"
tools:context="ru.lalala.olalala.MainActivity$PlaceholderFragment" >
<ImageView
android:id="@+id/imageViewPhotoReclame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitStart"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:contentDescription="@string/photo_reclame"
android:src="@drawable/restourant_main" />
<TextView
android:id="@+id/textViewReclameNews"
android:text="@string/main_text_reclame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/imageViewPhotoReclame"/>
</RelativeLayout>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question