ios - UIView drawRect issue -
i want make custom uiview border. here code:
- (void)drawrect:(cgrect)rect { cgcontextref context = uigraphicsgetcurrentcontext(); cgcontextsetlinewidth(context, 4.0); cgcontextsetstrokecolorwithcolor(context, [[uicolor bluecolor] cgcolor]); cgcontextaddrect(context, self.frame); cgcontextstrokepath(context); } and here result: 
all 3 uiview on picture custom view, big uiview have border. don't understand why others have no border. wrong?
you need local coordinates. change
cgcontextaddrect(context, self.frame); to
cgcontextaddrect(context, self.bounds);
Comments
Post a Comment