What is use of supportsRtl true in android example

What is use of supportsRtl true in android example

Android has full native support of RTL layout or text orientation since SDK 17 (Jelly Bean). Mostly mobile apps are designed in LTR (Left to Right) but few languages/designed are written from RTL (Right to Left).

That time developer need to declarar rtl in the android project. Android RTL engine automatically reverses the horizontal layout arrangement.

RTL Support in Your Android App – Tutorial

It has become very easy to take advantage of RTL feature and you need just few simple changes in your Manifest.xml code. If you do nothing, your app will not change but if you have made these changes your layout just got a reverse layout.

First of all, in your Manifest.xml file, you need to declare under the <application> element android:supportsRtl=”true”

<application
        android:supportsRtl="true"
        android:icon="@drawable/ic_launcher"
        android:theme="@style/AppTheme"
        android:label="@string/app_name">
.
.
.
.
.
</application>

if set android:supportsRtl=”true” and targetSdkVersion is set to 17 or higher, various RTL APIs will be activated and used by the system so your app can display RTL layouts. Remember If set android:supportsRtl=”true” and if targetSdkVersion is set to 16 or lower, the RTL APIs will be ignored or will have no effect.

Loading...

Hopefully these tips and android features could help you with your developing any application in RTL layout.

Related posts

(1) Comments

  • User Pic

    Good....

Write a comment