Android: ImageView scales up source image

扶醉桌前 提交于 2019-12-10 13:06:01

问题


I can't seem to get my ImageView to display its source image in its original size. The ImageView looks like this:

   <ImageView 
 android:id="@+id/Logo" 
 android:src="@drawable/logo"
 android:layout_width="wrap_content" 
 android:layout_height="wrap_content"
 >
</ImageView>

The source image is 140 pixels wide, yet on the Nexus One's screen, which is 480 pixels wide it uses up half of the width. Using absolute values in px or dp for the width and height changes nothing. The image also looks very antialiased from the upscaling. Why is this happening and how can I prevent it?


回答1:


Most likely, Android is scaling up the image, because you did not tell it you were supporting large screens. Add a suitable <supports-screens> element to your manifest and see if that helps.



来源:https://stackoverflow.com/questions/2938377/android-imageview-scales-up-source-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!