开发者

draw line over uilable after loading from nib

开发者 https://www.devze.com 2022-12-25 07:40 出处:网络
here is my code CGContextRef c = UIG开发者_如何学编程raphicsGetCurrentContext(); CGContextBeginPath(c);

here is my code

CGContextRef c = UIG开发者_如何学编程raphicsGetCurrentContext();
CGContextBeginPath(c);
CGContextMoveToPoint(c, 277.0f, 21.0f);
CGFloat newpoint = 277.0f + (CGFloat)(self.msrp.text.length * 8);
//NSLog(@"%f", newpoint);
CGContextAddLineToPoint(c, newpoint, 21.0f);
CGContextStrokePath(c);

i am trying to draw a line over UIlabel, i am loading my view from nib.i dont know what i am doing wrong. i just work fine if i draw entire view instead loading from nib.(but i dont wanna do that)..i hope my question is clear..


ok , finally i end up subclassing UIlabel. and then place my code in drawTextInRect.

0

精彩评论

暂无评论...
验证码 换一张
取 消