i trying add border bottom of .xib view. have following code places red border on 4 sides. want border on 1 side, bottom... how set border bottom?
current code class controls .xib:
- (void)awakefromnib { self.contentview.layer.borderwidth = 5.0f; self.contentview.layer.maskstobounds = yes; self.contentview.layer.bordercolor = [uicolor redcolor].cgcolor; }
calayer *bottomborder = [calayer layer]; bottomborder.bordercolor = [uicolor redcolor].cgcolor; bottomborder.borderwidth = 1; bottomborder.frame = cgrectmake(0, self.contentview.frame.size.height - bottomborder.borderwidth, self.contentview.frame.size.width, bottomborder.borderwidth); [self.contentview.layer addsublayer:bottomborder];
Comments
Post a Comment