In the screenshot below, I am attempting to get the text in the blue box to be aligned in the centre. It is to low down and needs to be lifted a pixel or two. I have been playing with the padding but it does not seem to have any effect.
The layout XML is here :
<RelativeLayout xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="5dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<TextView android:id="@+id/tvName"
android:layout_width="60dp"
android:layout_height="20dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="3dp"
android:background="@drawable/rectanglesegment"
android:gravity="center"
android:paddingBottom="2dp"
android:text="XXX" android:textSize="16sp"
android:textAppearance="?android:attr/textAppearanceMedium"/>
Any suggestions?
After feedback from @Snicolas I now have the following :
With this layout
<TextView android:id="@+id/tvName"
android:layout_width="60dp"
android:layout_height="fill_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:background="@drawable/rectanglesegment"
android:gravity="center"
android:text="abv" android:textSize="16sp"
android:textAppearance="?android:attr/textAppearanceMedium"/>