Why are the Width / Height of the drawable in ImageView wrong?

前端 未结 4 1871
失恋的感觉
失恋的感觉 2021-01-12 00:41

Should be a simple one.

When I pull image.getDrawable().getIntrinsicWidth() I get a value larger than the source image width. It\'s X coordinate is retu

4条回答
  •  攒了一身酷
    2021-01-12 01:16

    Check if it is returning the value of it's displayed size, which is not it's actual size. For example, a 50x320px banner ad on a traditional 800x480 phone displays as 75x480.

    Should be able to compare against density (or your eyes!) to see what it is doing.

提交回复
热议问题