[英]UINavigationBar Title and Buttons disappear after gradient is applied on iOS 11 Swift 4
[英]Buttons Disappear when I click after moving iOS
当我将按钮旋转旋转至横向时,该移动正确,但是当我单击时,它们全部消失了。 有人知道为什么吗?
UIButton *recordingButton = (UIButton *)[self.view viewWithTag:1];
CGRect frame1 = [recordingButton frame];
frame1.origin.x += 255;
frame1.origin.y -= 250;// change the location
[recordingButton setFrame:frame1];
UIButton *streamingButton = (UIButton *)[self.view viewWithTag:2];
CGRect frame2 = [streamingButton frame];
frame2.origin.x += 255;
frame2.origin.y -= 250;// change the location
[streamingButton setFrame:frame2];
UIButton *uploadButton = (UIButton *)[self.view viewWithTag:3];
CGRect frame3 = [uploadButton frame];
frame3.origin.x += 255;
frame3.origin.y -= 250;// change the location
[uploadButton setFrame:frame3];
这是因为您正在情节提要中使用自动布局。 您无法更改使用自动布局约束定位的视图的frame
。 是它的局限性 。 使用约束(最好是情节提要中的约束)来执行代码中的操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.