我使用imageView
來顯示活動圖像。此圖像大小不應根據設備屏幕更改。但這不起作用。我想爲每個設備使用圖像的實際大小。以下是我所嘗試過的。如何在android中的不同設備上保留相同的圖像大小
<?xml version="1.0" encoding="utf-8"?>
<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:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/circle"
android:id="@+id/imageView"
android:scaleType="center"/>
</RelativeLayout>
我怎樣才能使用相同的圖像大小,而不在每個設備屏幕上縮放? 有什麼想法。
謝謝。
你能舉個例子嗎?我對你的共享鏈接感到困惑。 – Barrier
@Brier,已經做到了。或者你想要什麼樣的代碼? – Vyacheslav
@Brier,你試過了嗎? – Vyacheslav