No context, no rendering drawing
////hmview.m//Uikit Practice////Created by Yaguangzhu on 15/9/9.//Copyright (c) 2015 Yaguangzhu. All rights reserved.//#import "HMView.h"@implementationHmview- (void) DrawRect: (cgrect) rect {//Drawing CodeUIImage *image = [UIImage imagenamed:@"jiangxin"]; //crop area, no outside displayUirectclip (CGRectMake (0,0, -, -)); //[Image Drawatpoint:cgpointzero];[Image Drawaspatterninrect:rect];}- (void) drawtext{NSString*text =@"Sdddfffffffffffffgrgijperwpjprthrjtjreptrhkrht"; CGRect TextFrame= CGRectMake (0,0, -, -); Nsdictionary*dict = @{nsfontattributename:[uifont Systemfontofsize: -], Nsforegroundcolorattributename:[uicolor Redcolor], Nsstrokewidt hattributename:@5 }; Uirectfill (TextFrame); //No Line breaks//[text Drawatpoint:cgpointzero withattributes:dict];[text Drawinrect:textframe withattributes:dict];}@end
Ios-uikit Practice