ios - Insets to UIImageView? -
i'd achieve :
- scale fill mode of image view
- insets
uiimageview
image not meet edges ofuiimageview
bottomline: want increase touch area of uiimageview
without stretching image beyond size.
is possible through storyboard ? if not can tell how programmatically ?
i can achieve similar functionality through uibutton
, setting image inset through storyboard cant find such thing uiimageview
.
using method given here :
uiimage *image= [myutil imagewithimage:[uiimage imagenamed:@"myimage"] scaledtosize:cgsizemake(80, 80)]; uiimageview* imgview = [[uiimageview alloc] initwithframe:cgrectmake(0, 0, 100, 100)]; imgview.contentmode = uiviewcontentmodecenter; [imgview setimage:image];
now insets become 100-80 i.e. 20 .
this workaround provide insets uiimageview. better answers welcomed.
Comments
Post a Comment