任何人都知道如何在所有設備上查看相同大小的圖像視圖? 像我有一個1.45釐米×1.45釐米的圖像... 它應該顯示爲1.45x1.45釐米的所有設備,不論其大小... 可以這樣做。 我需要它是相同的大小,因爲我目前正在開發驗光應用程序。 我目前的XML佈局.. /---------------------------------/不要在imageview中縮放圖像,而是將其顯示爲固定大小的圖像視圖
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="#ffffff"
tools:context="com.adityamhatre.project.Etest$PlaceholderFragment" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="14.5mm"
android:layout_height="14.5mm"
android:scaleType="fitXY"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@raw/e11" />
</RelativeLayout>
/---------------------------------/
所以你已經回答了你的問題:layout_width =「14.5毫米」 – pskink
@pskink它不工作,但..所有的Android大小 –
首先給出在「dp」和「dpi」上,請刪除「mm」。 –