3

Home up button in RTL is pointing left on Android 5.1(API 22) and lower: enter image description here

But on Android 6.0(API 23) everything is ok and it's pointing right.

enter image description here

How to solve that?

2

2 Answers 2

1

In your style.xml put:

 <item name="homeAsUpIndicator">@drawable/ic_arrow_back</item>

And create a drawable-ldrtl-xhdpi-v17 folder in res and put proper drawable (RTL drawable).

0

Solution 1 :

You can generate duplicates and keep versions in proper directories (e.g. drawable-ar).

Solution 2 (My Fav)

Fortunately, there is an easy way around. You just need to use styles.

values/styles.xml
<style name="MirroredImage" />

values-ar/styles.xml
<style name="MirroredImage">
    <item name="android:scaleX">-1</item>
</style>

my_layout.xml
<ImageView
    style="@style/MirroredImage"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/ic_to_be_mirrored"/>

Not the answer you're looking for? Browse other questions tagged or ask your own question.