ios - Insets to UIImageView? -


i'd achieve :

  • scale fill mode of image view
  • insets uiimageview image not meet edges of uiimageview

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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -