自定义底部tool

175 阅读1分钟

自定义底部 tool 的时候设置自定义按钮,怎么都不显示:代码如下

XHPBottomButton*comBtn = [XHPBottomButtonbuttonWithType:UIButtonTypeCustom];

[self.viewaddSubview:comBtn];

comBtn.frame=CGRectMake(0,CGRectGetHeight(self.view.bounds) -49,CGRectGetWidth(self.view.bounds),49);

设置高度是49 ,y 轴为当前视图高度减去49 ,

设置如下代码搞定,看来自动布局还是吊.

comBtn.autoresizingMask=UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleWidth;