2017-07-21 11 views
0

これを短くしようとしていますので、私はこのBluetooth Connectionアプリを作成しましたが、私の電話機では完全に機能しますが、友達の電話でテストしたとき、androidのローカリゼーションと言語の相違点

問題は、Linearlayoutと2つの異なるボタンを使用しています。イメージの背景には、お互いに横たわっている行があります。矩形の左側に円が立っていて、それは自分の作品です電話ではなく、別の言語(言語とAndroidの設定での入力)を持っている私の友人の電話には、円は長方形の右側にあります。

私はすでに電話言語を私のように英語に変更するとこれが修正できるという事実をすでに知っていることに注意してください。しかし、私はすべてのタイプのコスチュームの問題を引き起こさない解決策を探しています私の国には2つの異なる電話言語があります。

これはどうしたらいいですか?

How it looks on my phone

How it looks on my friend's phone

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" 
android:padding="@dimen/activity_vertical_margin"> 


<LinearLayout 
    android:orientation="horizontal" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_weight="1"> 



<FrameLayout 
android:layout_width="wrap_content" 
android:layout_height="200dp"> 


<Button 
    android:layout_width="75dp" 
    android:layout_height="70dp" 
    android:id="@+id/circle1" 
    android:background="@drawable/redcircle /> 

<Button 
    android:layout_width="75dp" 
    android:layout_height="70dp" 
    android:id="@+id/greenCircle" 
    android:background="@drawable/greencircle" 
    android:alpha="0"/> 




</FrameLayout> 


    <Button 
     android:layout_width="match_parent" 
     android:layout_height="60dp" 
     android:layout_marginTop="5dp" 
     android:id="@+id/rect1" 
     android:text="Bluetooth Turn On/Off" 
     android:textStyle="italic" 
     android:textColor="#fdfdfd" 
     android:background="@drawable/rects" 
     android:layout_weight="1" /> 



</LinearLayout> 

<LinearLayout 
    android:orientation="horizontal" 
    android:layout_weight="1.4" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
    <Button 
     android:layout_width="150dp" 
     android:layout_height="70dp" 
     android:id="@+id/circle2" 
     android:background="@drawable/gomb" 
     android:layout_weight="1" /> 

    <Button 
     android:layout_width="match_parent" 
     android:layout_height="60dp" 
     android:id="@+id/rect2" 
     android:textStyle="italic" 
     android:text="View paired Devices" 
     android:textColor="#fdfdfd" 
     android:enabled="false" 
     android:background="@drawable/rects" 
     android:layout_weight="1" /> 


</LinearLayout> 

<LinearLayout 
    android:orientation="horizontal" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_weight="0.9"> 

    <Button 
     android:layout_width="150dp" 
     android:layout_height="70dp" 
     android:id="@+id/circle3" 
     android:background="@drawable/gomb" 
     android:layout_weight="1" /> 

    <Button 
     android:layout_width="match_parent" 
     android:layout_height="60dp" 
     android:id="@+id/rect3" 
     android:textStyle="italic" 
     android:textColor="#fdfdfd" 
     android:enabled="false" 
     android:text="Scan for new Devices" 
     android:background="@drawable/rects" 
     android:layout_weight="1" /> 


</LinearLayout> 

答えて

0

あなたの友人の電話が右から左への言語であり、そして、あなたのアプリが右から左へ「をサポート」。のように見えますRTLをサポートすることはすばらしい目標ですが、時には実現不可能です。

ここではいくつかのオプションがあります。あなたのアプリケーションのRTLサポートを無効にするのが最も速い/最も簡単です。あなたが実際にアプリ内でRTLのために必要なサポートを提供しようとすることができ、

android:supportsRtl="false" 

または:あなたのAndroidManifest.xml<application>タグにこのATTRを追加します。この場合、おそらくボタンの背景に代替のドロアブルを指定することを意味します。あなたが現在持っている場合は、これらの:

res/drawable-mdpi/background.png 
res/drawable-xhdpi/background.png 
res/drawable-xxhdpi/background.png 

あなたはこれらを追加する必要があるだろう:

res/drawable-ldrtl-mdpi/background.png 
res/drawable-ldrtl-xhdpi/background.png 
res/drawable-ldrtl-xxhdpi/background.png 

そして、あなたの代わりに左のボタンの右側に曲率を置くところ。

関連する問題