如果设备语言是阿拉伯语,则布局更

Mai*_*das 9 android arabic imageview

我设计了一个Android应用程序,当我在设备中测试它的语言是阿拉伯语时,图像视图的位置会像镜子一样变化!

我需要一个解决方案来使布局与英语相同,因为我有图像视图,我根据屏幕宽度为它们做了翻译,所以当语言是阿拉伯语时; 屏幕宽度的1%从屏幕右侧开始!和我编程时的应用程序;图像视图从屏幕左侧开始!

我想要的解决方案不仅仅是更高的SDK!

我的一些java代码:

img = (ImageView) findViewById(R.id.imageView);
img2 = (ImageView) findViewById(R.id.imageView3);


in same function named go has parameters according to img1 and img2:

 dis = metrics.widthPixels * 0.043f;

 fromxall=metrics.widthPixels * 0.01f;
 toxall =  metrics.widthPixels * 0.05f + dis;

fromyall = 0;
 toyall = 0;

TranslateAnimation moveLefttoRight = new TranslateAnimation(fromxall, toxall, fromyall, toyall);
            moveLefttoRight.setDuration(300);
            moveLefttoRight.setFillAfter(true);
            imgx.startAnimation(moveLefttoRight);
Run Code Online (Sandbox Code Playgroud)

Con*_*ext 12

在你的清单文件中输入:

android:supportsRtl="false"
Run Code Online (Sandbox Code Playgroud)