0

2 つの画像で構成されるグラフを作成しています。1 つは背景画像、もう 1 つは実際のデータ ポイントを含む画像です。データ ポイントの画像は、背景画像の上部に配置されていることが示されています。

レイアウトは次のようになります。

<RelativeLayout
    android:id="@+id/graphImageWrap"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <ImageView
        android:id="@+id/graphImageBackground"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:background="@android:color/transparent"
        android:contentDescription="@string/stroom_grafiek"
        />
    <ImageView
        android:id="@+id/graphImage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@id/graphImageBackground"
        android:layout_centerHorizontal="true"
        android:background="@android:color/transparent"
        android:contentDescription="@string/stroom_grafiek"
        />
</RelativeLayout>

これは、HDPI デバイスでうまく機能します。 HDPI

しかし、MDPI デバイスでは正しく整列しません。 MDPI

誰かが問題が何であるかを説明できることを願っています。

4

1 に答える 1

0

代わりに FrameLayout を使用し、画像が同じサイズであることを確認してください。

于 2012-09-11T08:37:30.833 に答える