The problem I am having is aligning the second TextView
to the right of the TextView
which spans to two lines.
I am using a RelativeLayout
, but when I use layout_toRightOf
it appears at the top of the screen, and when I add layout_alignRight
it disappears.
I am very confused how this works. You would assume that it would follow where the first TextView
ends, but it does not. Oh, and I am using wrap_content
on width and height incase anyone thinks that's the problem. Thanks in advance.
XML
<TextView
android:id="@+id/edit_event_name_show"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18dp"
android:textStyle="bold"
android:layout_marginBottom="5dp"
android:scrollHorizontally="false"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" />
<TextView
android:id="@+id/show_event_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10dp"
android:scrollHorizontally="false"
android:layout_toRightOf="@+id/edit_event_name_show"
android:layout_alignBaseline="@+id/edit_event_name_show" />
EDIT: To anyone that ever has a similar issue with trying to align things nicely with TextViews, there is not a way by default. But you can use SpannableString
and build them using SpannableStringBuilder
.