Issue
Is there any way to have different images for different languages for an ImageView?
Imagine i have this two picture, first one is for a right to left language and second one is for an left to right language, how can i apply the proper image to the ImageView based on my application Locale?
<ImageView
android:id="@+id/message_icon"
android:layout_width="@dimen/message_text_icon"
android:layout_height="@dimen/message_text_icon"
android:src="@drawable/sent_message_icon"
android:padding="@dimen/padding_small"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"></ImageView>
Solution
Place normal image in the drawable-*
folder rtl image in the drawable-ldrtl-*
folder.
If you want to use single image:
Place <integer name="angle_rtl_180">0</integer>
in values/integers
and
<integer name="angle_rtl_180">180</integer>
in values-ldrtl/integers
then use rotationY
attribute in the imageView as:
android:rotationY="@integer/angle_rtl_180"
Answered By - Nabin Bhandari
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.