开发者

Can UI elements be included inside a .a library?

My client wants to make a library in which all the processing and UIelements will be inside the library and He will extend his already existing app by using this library.. can you quote some example whe开发者_如何学Cre this has already been done?


You cannot include resource files (like images or XIB-Files) in a static library (*.a). That means you have to create the UI elements in code. Creation of UIKit-Elements is simple:

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,0,100,20)];
[someView addSubview:label];

If you want to create custom views (UIView subclass) you'll have to do the drawing with Core Graphics. As an alternative you could load resources from the web.

As an example, the Testflight SDK is released as a static library that uses some custom UI for its in-app features. I guess the resources are loaded from the web and cached in the app.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜