私は現在画像がimageview
です。 2.7インチのテスト画面では完璧に見えますが、4.3インチの画面でテストすると、イメージはどこにあるのかわかりません。高さをdp
に設定しています。イメージファイルはhdpi、mdpi、およびLdpiの各フォルダにあります。私は何か間違っているのですか?それとも、画像の場所をロックして、すべての電話サイズで同じ方法で表示する方法がありますか?おかげさまで Android-さまざまな画面サイズの画像を調整します
様々な画面サイズに調整されていないimageview
が最初imageview
(ID = sdrbg)である ここに私のレイアウトファイルです:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout1" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<ImageView android:layout_width="wrap_content"
android:layout_alignParentTop="true" android:id="@+id/sdrbg"
android:background="@drawable/sdrmaingraphic" android:layout_height="289dp"></ImageView>
<ImageView android:id="@+id/canvasBOM"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="false" android:layout_width="fill_parent"
android:background="@drawable/canvas" android:layout_height="100dp">
</ImageView>
<Button android:layout_alignParentBottom="true"
android:id="@+id/playpausebuttonBOM" android:background="@drawable/main_pause_button"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_marginLeft="10dp"></Button>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/nextbuttonBOM"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true" android:background="@drawable/next_song_button"
android:layout_marginRight="10dp"></Button>
<TextView android:id="@+id/textView1" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:text="Best of May 2011"
android:textSize="20dp" android:textStyle="bold"
android:layout_centerHorizontal="true" android:layout_centerVertical="false"></TextView>
</RelativeLayout>
ImageViewのレイアウトおよびサイズに影響を与える要因はたくさんあります。あなたはレイアウトファイルを共有できますか? –
@ダン:私のレイアウトコードを追加しました – Splitusa