简体   繁体   English

在IB中编辑从屏幕开始的视图

[英]editing views in IB that start off the screen

I have some views that start off the screen and then slide in and out at various times. 我有一些视图从屏幕开始,然后在不同的时间滑入和滑出。 In IB, the x,y positions are off the screen, because that is where I want them to start. 在IB中,x,y位置不在屏幕上,因为这是我希望它们开始的位置。

Now, I could just put them anywhere in the x,y space in IB and have the viewController's viewDidLoad method move them off the screen initially. 现在,我可以将它们放在IB的x,y空间中的任何位置,并让viewController的viewDidLoad方法最初将它们移出屏幕。

My question is, since they are currently off the screen in IB, is there an easy way to access and edit them in IB without changing the x,y position of a view first so that it appears on the screen in IB? 我的问题是,由于它们当前不在IB的屏幕上,是否有一种简单的方法可以在IB中访问和编辑它们,而无需先更改视图的x,y位置以使其出现在IB的屏幕上? Because I am editing these views fairly often. 因为我经常编辑这些视图。

If there isn't, then I'll probably just position them anywhere in the visible space in IB and add some stuff to viewDidLoad to get them out of the way. 如果没有,那么我可能只是将它们放置在IB中可见空间中的任何位置,然后向viewDidLoad中添加一些内容以使其摆脱干扰。 Or any other suggestions I'd love to hear. 或其他我想听听的建议。

You click there 你点击那里

在此处输入图片说明

and then select your view here 然后在这里选择您的视图

在此处输入图片说明

If it's a separate view, just drag it to where you want it, and double click it's name in the objects list as seen in edo42's answer. 如果是单独的视图,只需将其拖到所需位置,然后在对象列表中双击它的名称即可,如edo42的答案所示。 You could also figure out the final x/y coordinates and set those with your code, and just move the view wherever is convinient. 您还可以找出最终的x / y坐标,并使用代码进行设置,然后仅在方便的地方移动视图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM