I can't place the label where i want. I will show a picture.
I have the following code:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="@+id/textViewNombreVideo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/imageViewLogo"
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/imageViewLogo"
android:lines="2"
android:scrollHorizontally="false"
android:singleLine="false"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearance"
android:textColor="@android:color/white"
android:textColorLink="@android:color/white"
android:textStyle="bold" />
<ImageView
android:id="@+id/imageViewLogo"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/textViewNombreVideo"
android:layout_centerHorizontal="true"
android:layout_margin="4dp"
android:adjustViewBounds="true" />
</RelativeLayout>
The picture fit the heigh of the imageview, that's ok, and i want to place the textview with the same left of the picture.
Is it possible to do that?
Try this code.
<?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:layout_gravity="center"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="@+id/textViewNombreVideo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_alignLeft="@+id/imageViewLogo"
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/imageViewLogo"
android:lines="2"
android:scrollHorizontally="false"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearance"
android:textColor="@android:color/black"
android:textColorLink="@android:color/white"
android:textStyle="bold"
android:layout_marginBottom="10dp" />
<ImageView
android:id="@+id/imageViewLogo"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/textViewNombreVideo"
android:layout_centerHorizontal="true"
android:layout_margin="4dp"
android:src="@drawable/ic_launcher"
android:adjustViewBounds="true"
/>
</RelativeLayout>
below UI design fron this code. as per your requirement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With