Today I’ll be super busy preparing the order of a true legend — @Joseinnewworld, who just swept around 58 #NFTs 😳🔥 That’s insane support… looks like I’ll be pulling an all-nighter to get everything ready 😅🙌 #NFT #NFTCollection #NFTCollectors #eCash $XEC #CryptoMevXBOT https://t.co/5iHxVEGjRo pic.twitter.com/xjpvlw34L6
— NFToa (@nftoa_) August 19, 2025
Hi dev, initially I tried to do centering component button by calling gravity and orientation attributes, but it didn't work, then with a little force I tried to connect each side of the button with the closest possible elements, but the results were less than optimal. Finally, because there was still a lot of spare time, I took out the google fu trick and it turned out that the Android SDK already provides a facility to do that.
The facility I mean is this attribute.
android:layout_centerHorizontal="true"Usage example.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ff0000">
<Button
android:id="@+id/btn_mybutton"
android:layout_height="wrap_content"
android:layout_width="124dip"
android:layout_marginTop="5dip"
android:layout_centerHorizontal="true"/>
</RelativeLayout>Great!
