ios - UIImageView content mode -
the bluish line imageview's bounds. uiimageview
's contentmode
uiviewcontentmodescaleaspectfit
, , want maintain original picture's scale. how can create picture's left border on uiimageview
's left edge? not uiviewcontentmodetopleft
mode. maintain scale , no blank in left. english language not good, hope guys understand i'm saying. give thanks much.
yourimageview.contentmode = uiviewcontentmodecenter; if ( yourimageview.bounds.size.width > yourimageview.size.width && yourimageview.bounds.size.height > yourimageview.size.height) { yourimageview.contentmode = uiviewcontentmodescaleaspectfit; }
you can alter mode as
typedef ns_enum(nsinteger, uiviewcontentmode) { uiviewcontentmodescaletofill, uiviewcontentmodescaleaspectfit, // contents scaled fit fixed aspect. remainder transparent uiviewcontentmodescaleaspectfill, // contents scaled fill fixed aspect. portion of content may clipped. uiviewcontentmoderedraw, // redraw on bounds alter (calls -setneedsdisplay) uiviewcontentmodecenter, // contents remain same size. positioned adjusted. uiviewcontentmodetop, uiviewcontentmodebottom, uiviewcontentmodeleft, uiviewcontentmoderight, uiviewcontentmodetopleft, uiviewcontentmodetopright, uiviewcontentmodebottomleft, uiviewcontentmodebottomright, };
ios objective-c uiimageview
No comments:
Post a Comment