iphone - UIImageView and UIImage of equal size -
i came across weird scenario in code other day:
i have uiimageview loads image setimage:. uiimageview prior initialized frame having exact size of image (41*41 px). set content mode uiviewcontentmodecenter, should ensure image never scaled.
now when @ image view see image bit cropped horizontally , appears little blurred (this telltale sign rescaling happening in background). if instead initialize image view 1 pixel in width, works (however image view 1 pixel wider image).
also if initialize uiimageview initwithimage: seems work fine too. checked view's frame after initialization , found of same size: 41*41.
so bottom line have few workarounds issue, i'm trying understand what's happening here. explanations can think of are:
- there bug in framework
- the rendering of images doesn't work images of particular size. know examples textures powers of 2, though doubt has significance uiimageview.
for record i'm compiling os 3.0 , issue happens on both simulator , device.
is uiimageview contained inside other views? 1 thing i've had before blurred controls caused fractional pixel offsets. i.e. if calculate frame using division , end non-integer float value uikit can add strange blurring @ offsets , sizes.
so image view may have integer size, it's absolute frame when taking parent(s) consideration may not be.
Comments
Post a Comment