开发者

Design views in IB and use them few times with different content?

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜