is it possible to design a view in interfacebuilder and use it dynamically a few times?
the view structu开发者_JAVA技巧re is
- UIScrollView
- UIView
- UIImageView
- UILabel
now i want to dynamically create multiple instances of the UIView in a for loop with different UILabels and UIImageViews. I want to give them side-by-side in the imageview.
thanks + regards
Sure. Just call:
[[NSBundle mainBundle] loadNibNamed:@"myNibName" owner:self options:nil];
It returns an array that contains all top-level objects you have placed in the NIB file. You can then assign those objects to any of your instance variables/properties. See the documentation for details.
精彩评论