iOS - How to properly scale UIButton with varying image sizes (like Facebook News Feed)? -
i attempting replicate facebook's news feed app, , have images should displayed. images variety of sizes, how should scale them fit cell without looking weird?
the cell contains uibutton has image set it. using button want open total size image when pressed. if improve alter uiimageview tap gesture can too, thought button simpler.
ideas?
+ (uiimage *)imagewithimage:(uiimage *)image scaledtosize:(cgsize)newsize { uigraphicsbeginimagecontextwithoptions(newsize, no, 0.0); [image drawinrect:cgrectmake(0, 0, newsize.width, newsize.height)]; uiimage *newimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); homecoming newimage;
}
use scale image based on size.
ios image uitableview uibutton scale
No comments:
Post a Comment