Cocoa, Cocoa Touch, and Vertical Separators
In Interface Builder for Cocoa applications, there are two objects in the "Library" pane - Vertical Separator and Horizontal Separator. These two objects are nice to have to lay out views just the way I like them. However, when I started in Cocoa Touch a year or two ago I noticed those two objects开发者_开发技巧 were not there.
Why is it that the Vertical and Horizontal separators that are present in the Object Library in the Cocoa environment are not there when a Cocoa Touch xib
is loaded up?
(As a concession, I know I can accomplish the same task by utilizing a UIImageView, but it's not exactly the same.)
The paradigm to designing apps for the iPhone is different from the mac, so you can't expect for the IB objects to be exactly the same.
If you are trying to use vertical separators, I'd recommend you to re-think your UI, it may not be something your user expects, the iPhone screen is limited in it's size, specially horizontally, so it's best to expand your content vertically, that's why UITableView is one of the most used ways to display info.
(I know the iPad doesn't have that limitation, but that's probably why the UISplitViewController exists).
Cocoa and Cocoa Touch don't use the same libraries for building UIs. Cocoa provides Application Kit, which includes NSView and its subclasses. Cocoa Touch provides UIKit, which includes UIView and its subclasses.
One of the NSView subclasses is NSBox; accordingly, this class is not present in UIKit. Both of the “separators” in Xcode's AppKit object library are just one-point-wide/-tall NSBox instances; accordingly, these objects are not present in Xcode's UIKit object library.
精彩评论