in Android XML I am try to set the alignment of the text to right:
android:gravity="center_vertical|right"
I also align it in the center of the parent, hence the center add in. Now I have the text on a right alignment but I want to assign it to the position of the parents left:
android:layout_alignParentLeft="true"
But this only keeps the alignment of the text and does not align to the parents center? Heres the entire view xml code:
<TextView
android:id="@+id/textview_example"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical|right"
android:layout_alignParentLeft="true"
android:textColor="#474747"
android:textSize="14sp" />
Can someone help me create a solution for having the textview's text aligned to the right but be assigned to the parents left?
TextView
within aLinearLayout
or aRelativeLayout
?android:gravity
is for use on elements within aLinearLayout
;android:layout_alignParentLeft
is for use on elements within aRelativeLayout
.