开发者

How in Interface Builder can you select a rectangular group of items when they're on top of a background item?

I've had this problem several times now, and never found a satisfactory solution: If I want to move a group of items with a view all together in Interface Builder, and these items are all on top of a larger background item, I can't put a selection rectangle around the items in the view because any click and drag in the view initiates a move of the background item. In other words, every pixel in the area I'm interested in (and nearby) has a "hand" mouse pointer, no "arrow" pointer is available so I can't drag out a rectangle selection box.

cmd-clicking individual items to build up the group only works when they are separate, and only when there are a few of them. Sometimes I want to select a "pi开发者_如何转开发le" of items all on top of each other.

Is there some way to "select for moving" by clicking in the .xib item list? Double clicking a single item selects it for moving in the view, but I have't found a way to add to the "select for moving" selection this way.

So far the best way I've found is temporarily moving the background out of the way and then putting it back but this is unsatisfactory, and wouldn't work with a more complex background arrangement.

How have others done this?


I know what you mean, and I have found a slightly better solution: go to the list view and...

  1. drag either the background view or your custom view up to the root hierarchy level (adjacent to File's Owner)
  2. double click on your custom view and edit away using drag-box-selection
  3. when finished, drag the view back into its original hierarchy position

The key here is that the GUI editor only edits one root object at a time, so moving the background vs. 'foreground' views into separate root objects allows you to edit them separately. Woo!


This is my solution to this problem: Select the background images/object that you don't want to move and set its width to 1 and then, after a comfortable layout editing, restore its original width. This works for me.


Use the left hand side list view and multi-select a range by clicking on the first item in the range then shift-click on the last item. Use ctrl-click to unselect some items if necessary. As items are selected they will also show as being selected in the interface view on the right.

Once have set up all the selected items, cmd-click on the selected items in the right hand side interface view and drag.


In the list of objects, cmd+click each one you want to select them all. In the interface hold command and click and drag the stack of items. Drag them to where you want them and release cmd. If you don't release the button they will rubber band back to their original position.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜