How to create a custom UIView?
问题 I've created a UIView subclass and corresponding xib file where I've laid out some UILabels and UIImageViews. I want to then put multiple copies of this custom UIView into a UIViewController. When I do that they appear blank in interface builder and don't appear when the app loads. What methods do I need to implement on the UIView subclass to make this work? 回答1: The easiest method by far is to create a nib with File's Owner set to NSObject, containing one view containing your layout element.