Centering an ImageButton and a TextView in a RelativeLayout
-
27-09-2019 - |
Question
android:layout_gravity="center"
doesn't seem to work the same in a RelativeLayout
as it does in a LinearLayout
.
I would like both an ImageButton
and a TextView
to be centered in a RelativeLayout
- is there a basic xml
code for this?
Solution
android:layout_centerHorizontal="true"
Also :
android:layout_centerInParent
android:layout_centerVertical
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow