我正在製作一個Android應用程序,我正在使用ImageView.My圖像在普通手機屏幕 上完美顯示,但在大屏幕設備(如Tabs)上,它變得越來越小,在左側屏幕。那麼什麼是最適合相同的解決方案?Android Imageview越來越小
這是我的XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/rl"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#550e8c" >
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#550e8c"
android:text=""
android:textColor="#e2ffff" />
<Button
android:id="@+id/help"
android:layout_width="52dp"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/textView2"
android:layout_alignParentTop="true"
android:layout_alignRight="@+id/textView2"
android:background="#550e8c"
android:drawableLeft="@drawable/help1" />
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/rl"
android:background="#E5E3E4"
android:orientation="horizontal"
>
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/home"
android:adjustViewBounds="true"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="5dp"
android:orientation="vertical" >
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="52dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#781a8f"
android:drawableLeft="@drawable/earthnew1"
android:drawablePadding="30dp"
android:gravity="left|center_vertical"
android:paddingLeft="10dp"
android:text="@string/aware_patient"
android:textColor="#e2ffff"
android:textStyle="bold" />
<Button
android:id="@+id/btnCardiology_updates"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="6dp"
android:background="#781a8f"
android:drawableLeft="@drawable/updates1"
android:drawablePadding="30dp"
android:gravity="left|center_vertical"
android:paddingLeft="10dp"
android:text="@string/Cardiology_updates"
android:textColor="#e2ffff"
android:textStyle="bold" />
<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="6dp"
android:background="#781a8f"
android:drawableLeft="@drawable/linknew1"
android:drawablePadding="30dp"
android:gravity="left|center_vertical"
android:paddingLeft="10dp"
android:text="@string/useful_links"
android:textColor="#e2ffff"
android:textStyle="bold" />
<Button
android:id="@+id/button4"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="6dp"
android:background="#781a8f"
android:drawableLeft="@drawable/linknew1"
android:drawablePadding="30dp"
android:gravity="left|center_vertical"
android:paddingLeft="10dp"
android:text="@string/Useful_journlas"
android:textColor="#e2ffff"
android:textStyle="bold" >
</Button>
</LinearLayout>
</RelativeLayout>
烏爾使用圖像HIGHT和寬度WRAP_CONTENT所以硫雜聯樹脂使用HIGHT和寬度固定像50dp 50dp – 2014-10-28 05:36:18
我認爲你必須爲7和10製作圖像的圖像,並放在各自的可繪製文件夾,如sw600和sw720。 – 2014-10-28 05:37:09
問題可能與解決方案有關。使用高分辨率圖像並放置在xhdpi和xxhdpi可繪製文件夾中。 – Akhil 2014-10-28 05:38:20