2010-10-25 46 views
0

我有一个RelativeLayout在我有两个图像。问题是:扩大规模。他们显示的方式比预期的要大。这里是我的布局:我的布局中的图像放大,但不应该。我怎样才能防止图像缩放?

<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"/> 

谁能告诉我什么,我做错了什么? 谢谢!

回答

0

布局看起来不错。

你在哪里存储这些图像?例如,如果您将它们放入所需大小的drawable-ldpi文件夹中,然后在模拟器上测试运行mdpi设置或hdpi设置,图像将变大,则必须根据您的设计正确决定将它们存储在哪里。

这些标签不需要xml名称空间,您可以在没有它的情况下编写它们,这只是xml文件的主标签所必需的。

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

坦克你!我在drawables文件夹中存储了一些grafics,因为我不想为所有分辨率使用相同的图像。 – notme 2010-10-25 15:25:35

相关问题