我使用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