Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force RTL layout direction not working

I am trying to add RTL support in my app where layout direction should also change to RTL on force setting to RTL.

I have followed:

Set minSdkVersion to 19 , Added android:supportsRtl="true" to application tag in AndroidManifest.xml, Switched left/right attributes to start/end

Followed this link.

However, even when I use the "Force RTL Layout Direction", my app doesn't display the RTL layout. The system UI is flipped to RTL, and other apps also support RTL.

Is there anything else that need to be done?

like image 237
stack Learner Avatar asked Mar 01 '26 01:03

stack Learner


1 Answers

in manifest.xml add android:supportsRtl="true" in tag

and in every activity add this line in onCreate method

getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
like image 177
Yusef.Naser Avatar answered Mar 02 '26 14:03

Yusef.Naser



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!