2012-06-11 81 views
-2

有一个奇怪的问题,图像下方具有136x166WRAP_CONTENT产生问题

enter image description here

大小给予当我设置在ImageView的/按钮与wrap_content那么这个图像变大

<Button 
    android:id="@+id/btn_reports" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="@drawable/report_image" /> 

输出:with wrap_content

enter image description here

<Button 
     android:id="@+id/btn_reports" 
     android:layout_width="136px" 
     android:layout_height="166px" 
     android:background="@drawable/report_image" /> 

输出:有固定大小IMAGESIZE(原136x166)

enter image description here

为什么这样,任何人面对这个问题?

+0

其中绘制的文件夹你把图片放进去了吗?也许它的规模扩大,因为它在密度不正确的文件夹? – Zelleriation

+0

你在哪里准确地放置了这张图片? –

+0

只有一个文件夹“drawable”,没有后缀。 –

回答

0

这是因为我创建的图标为hdpi并把图标drawable夹,而不是drawable-hdpi

我有我自己的解决方案,同时做研究Application support multiple屏幕,你可以找到答案here