我有uiviewController作为主视图,然后我添加了子视图叫做“supporteview”。现在我在supportview上以编程方式添加按钮。 由于某些原因,按钮不可见,但是当我在主视图中加载按钮时,我能够看到按钮。添加子视图,这是再次通过超级视图
[self.view addSubview:self.supportview]; [self.view bringSubviewToFront:self.supportView]; [self.supportView addSubview:self.btn]; [self.supportView bringSubviewToFront:self.button];
我已经加入滑块supportView然后加载按钮。
你是动态生成按钮,或者是里面的故事板? –
动态生成。 – Rupinder
尝试更新按钮的框架。将x和y原点设置为0.您的按钮框架。 –