Answer the question
In order to leave comments, you need to log in
Why is it not aligned exactly to the right?
We want the contents of the large liner layout (where the textview and the other linerlayout) are aligned equally to the right. How to do it? Tried with android:gravity="end"
, but the child linerlayout still recedes to the left.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
android:padding="8dp"
android:orientation="vertical">
<TextView
android:id="@+id/item_message_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
tools:text="Message"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/font_size_subtitle"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/item_message_view_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="views"
android:layout_marginEnd="10dp"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/font_size_additional" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="time"
android:textSize="@dimen/font_size_additional"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
Answer the question
In order to leave comments, you need to log in
In fact, you have them aligned correctly, something is wrong with the display in the studio.
try to remove dimasik100200 from markupandroid:layout_marginEnd="10dp"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question