Android 我的布局中的图像会放大,但不应放大。如何防止图像被缩放?

Android 我的布局中的图像会放大,但不应放大。如何防止图像被缩放?,android,image,scaling,Android,Image,Scaling,我有一个相对论,其中我有两个图像。问题在于规模的扩大。它们的显示方式比预期的要大。以下是我的布局: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gallery_batch" android:layout_width="wrap_content" android:layout_height=&q

我有一个相对论,其中我有两个图像。问题在于规模的扩大。它们的显示方式比预期的要大。以下是我的布局:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gallery_batch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/batch_background">
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/icon_success"
    android:id="@+id/view_batch_icon"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_centerVertical="true"
    android:padding="5dp"
    android:layout_gravity="center_vertical"/>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/text_bereits_geladen"
    android:layout_toRightOf="@id/view_batch_icon"
    android:layout_centerVertical="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="5dp"/>

谁能告诉我我做错了什么吗?

布局看起来不错

您将这些图像存储在哪里?例如,如果您将它们以您想要的大小放在drawable ldpi文件夹中,然后在运行mdpi设置或hdpi设置的模拟器上进行测试,则图像将更大,您必须根据您的设计正确决定将它们存储在何处

这些标记不需要xml名称空间,您可以编写它们而不需要它,这只需要xml文件的主标记

<ImageView xmlns:android="http://schemas.android.com/apk/res/android"

加油!我在drawables文件夹中存储了一些图像,因为我想对所有分辨率使用相同的图像。