开发者

how to add UILabel relative to other UI elements in iOS

how do you add a label relative to other UI elements(开发者_如何学运维custom views/controls as well)?


You should operate on frame property (eg. put label at bottom of the button):

CGRect buttonRect = self.myButton.frame;
buttonRect.origin.y = buttonRect.origin.y + buttonRect.size.height;
UILabel *lbl = createALabel();
lbl.frame = buttonRect;
[self.myButton.superview addSubView:lbl];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜