mybuttonConstraint.constat = 0;[self.vIEw layoutIfNeeded];
在vIEwWillAppear中,按钮的高度为0,但在模拟器上,按钮的标题仍然可见.即使按钮的标题是可见的,该按钮是不可插拔的,它不执行任何 *** 作.
到底是怎么回事?
解决方法 您可以在界面构建器上检查剪辑子视图,或者如果要通过代码尝试此 *** 作:mybuttonConstraint.clipsToBounds = YES
从苹果文档:
总结clipsToBounds
A Boolean value that determines whether subvIEws are confined to the bounds of the vIEw.
@property(nonatomic) BOol clipsToBounds
discussion
Setting this value to YES causes subvIEws to be clipped to the bounds of the receiver. If set to NO,subvIEws whose frames extend beyond the visible bounds of the receiver are not clipped. The default value is NO.
以上是内存溢出为你收集整理的ios – UIButton高度为0,但标题仍然可见全部内容,希望文章能够帮你解决ios – UIButton高度为0,但标题仍然可见所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)