0

デバイスの画面サイズが非常に多いため、特定の画像の近くに ImageButtons を配置することに問題があります。1 つまたは 2 つの画面サイズのすべてを配置することは可能ですが、間違った場所に配置するようになるため、それ以上はできません。この問題の解決策を探したところ、すべての画像を最適化してdistances programmatically but a lot of programmmatical properties require 11 API for it. My app should work with 2.2, 2.3 versions too. Another solution is the creating of layout qualifiers but there is some screen sizes where my imageButtons position a bit wrongly and this way demand to create a lot of files, folders. Could you recommend me something interesting in this issue? Something what is more optimal and doesnデバイスのパフォーマンスを過度に高めてしまう可能性があることがわかりました。この絵を実現しようとしていますhttp://s018.radikal.ru/i507/1209/07/e3f1024a5780.jpg

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rlInjury"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:padding="10dp" >

<ImageView
    android:id="@+id/imMonkey"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scaleType="fitCenter"
    android:scaleX="0.8"
    android:scaleY="0.8"
    android:src="@drawable/monkey" />

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

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

        <ImageButton
            android:id="@+id/ib1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:scaleType="fitCenter"
            android:src="@drawable/pointer1" />

        <ImageButton
            android:id="@+id/ib2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:scaleType="fitCenter"
            android:src="@drawable/pointer3" />
    </LinearLayout>

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

        <ImageButton
            android:id="@+id/ib4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:scaleType="fitCenter"
            android:src="@drawable/pointer2" />

        <ImageButton
            android:id="@+id/ib5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:scaleType="fitCenter"
            android:src="@drawable/pointer2" />
    </LinearLayout>
</LinearLayout>

4

1 に答える 1

0

私の意見では、layout-small、layout-large、layout-medium など、画面サイズのデバイスごとにレイアウト (xml) ファイルを作成する必要があります。そのような方法はないと思います。

于 2012-09-16T15:17:33.653 に答える