in Android RelativeLayout we can set the textView exactly in the center of the screen using this code:
<TextView android:text="This is TextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_centerHorizontal="true" />
result:
top - - - - This is TextView (center vertical) - - - - bottom
But I need the textView to go down a bit, I'm trying to add marginTop , but it seems that after using layout_centerVertical=true this becomes impossible. Any solution?
Expected result (slightly lower):
top - - - - - - This is TextView (center vertical slight to bottom) - - bottom
source share