开发者

Load UIView from nib file?

I have one large view with a toolbar that allows a user to select how they want data displayed. When they select what data they want displayed, a smaller UIView (contained within the original one) should change to show the data they want displayed.

I would like to load that small UIView from a different nib file, but the toolbar (in the larger view) should not disappear, i.e. I don't开发者_如何学Go want that view larger to go away, only the small view should be changed. I have different nib files for each data view.

How can I load the small UIView from a given nib file?


I've did this before.

SimpleCell *cell = [[[NSBundle mainBundle] loadNibNamed:@"FriendsCell" owner:self options:nil] objectAtIndex:0];

owner is not necessary. and the index should be the same of the index inside the nib. (the first object(Not the file's owner nor First Response) starts from 0)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜