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 デバイスでうまく機能します。
しかし、MDPI デバイスでは正しく整列しません。
誰かが問題が何であるかを説明できることを願っています。