Android TextView gravity

I am writing an application for devices with Android 3.0 and higher. This is an arabic app.

By default, the platform aligns Arabic text on the right (even in dialog boxes) and English text on the left.

But when I set gravity = "right" for the Arabic text, it aligns the left.

Another problem occurs with some devices (for example, on the Samsung Galaxy 10.1, NOT ALL! Tab). It looks like they fixed it, and now it aligns the Arabic text to the left by default!

How can i fix this?

+4
source share
1 answer

Workaround: 1. remove the android:gravity value. 2. Set the android:layout_width to wrap_content . 3. set android:layout_gravity to whatever boolean you want.

this works great with TextView because it has no content other than text.

Other than that, I don’t know.

anyway he reported a bug on google see this: http://code.google.com/p/android/issues/detail?id=14529

0
source

Source: https://habr.com/ru/post/1403612/


All Articles