Android: How to prevent image from being scaled in ImageView or ImageButton?

后端 未结 3 1487
难免孤独
难免孤独 2020-12-29 13:21

How can I prevent my bitmap from being scaled automatically in an ImageView or ImageButton if the view or button is stretched using \"fill_parent\" or using \"weight\"?

3条回答
  •  無奈伤痛
    2020-12-29 13:34

    If the image is scaled, make sure you are not running your app in compatibility mode (for instance if you target Android 1.5/1.6 without supporting multiple densities and you run the app on Android 2.0.)

提交回复
热议问题