Hello, I ran into a little problem.
I use GRAVITY LEFT to make text for the left side of the view, but I want to focus inside the text box, but also align to the left
Here is what I have now:
___________________________________ _ _ _ _ _ _| aaaaaaaaaaaaa |_ _ _ _ _ _ _ _ _ _ _ _| aaaaaaaa |_ _ _ _ _ _ _ _ _ _ _ _| aaaaaaaaaaaaaa |_ _ _ _ _ _ -----------------------------------
I want:
___________________________________ _ _ _ _ _ _| aaaaaaaaaaa |_ _ _ _ _ _ _ _ _ _ _ _| aaaaaaaa |_ _ _ _ _ _ _ _ _ _ _ _| aaaaaaaaaaaaaa |_ _ _ _ _ _ -----------------------------------
Where:
_ _ _ _ = outside textview
| = edge of TextView
I tried android: gravity = "left | center", but this does not work, any idea?
thanks
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/image_button_wrapper" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:layout_centerVertical="true"> <ImageView android:id="@+id/left_button_image" android:layout_centerVertical="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="@dimen/spacing_normal"/> <Textview android:id="@+id/textview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/left_button_image" android:gravity = "center|left|left" android:clickable="false" android:focusable="false" app:font_name="Roboto-Light.ttf"/>
What am I (text aligned left but not centered) 
What I want (the text is aligned left and center) (I add the addition manually to get the render, but it is dirty and will not adapt to the whole text): 
android text textview gravity
Foushi
source share