简体   繁体   中英

locking views in Xcode storyboard

coming from a design background myself, I like to use the storyboard as much as I can before I jump into code. That being said, I was wondering if there is a feature in Xcode that enables locking some views while adjusting other views.

Let me explain by an example.. the currently selected view is a tiny 1x60px image.. that is on top of several other images.. unfortuantely Xcode doesn't allow you to zoom in more than this level (that would have solved it). I was wondering if I can lock the other images (ie SliderContainer, blackcab_comb, funryde_com, train_comp so that they're not affected by what I do with the view.. what's happening right now is that when I try to drag the small view around, I keep on dragging the views behind it.

the way I currently deal with this is just simply updating the x,y values of the view until I get it right.. There must be a better way.

在此处输入图像描述

go into the identity inspector and under lock select all properties.

https://abhimuralidharan.medium.com/how-to-lock-ui-element-properties-in-storyboard-ios-9706a94368a7

You really shouldn't drag views around. For one, because of what you just said. Another reason being, if you're working with auto layout, you add constraints after an hour of work, then you decide do drag something, instead of changing it's X/Y value, it will mess up all the constraints.

To answer your question, I don't think there is such a feature.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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