[英]How can I add an additional "view" to my iphone app?
I have a simple iphone app that's based on the CrashLanding sample app.我有一个基于 CrashLanding 示例应用程序的简单 iphone 应用程序。 So basically you tap the title screen and do some stuff... all on the same "view".
所以基本上你点击标题屏幕并做一些事情......都在同一个“视图”上。 I want to add an "options" screen/page/view whatever with a few UISwitches.
我想用几个 UISwitch 添加一个“选项”屏幕/页面/视图。 What's the easiest way to do this?
什么是最简单的方法来做到这一点?
Cheers!干杯!
There are numerous examples that show how to manage multiple full-screen views -- each view should typically be managed by a separate view controller.有许多示例展示了如何管理多个全屏视图——每个视图通常应该由单独的视图控制器管理。 Check the Xcode templates for an example of how you can set up a "flip" view.
查看 Xcode 模板,了解如何设置“翻转”视图的示例。
Dunno if this will help I'm a bit new to objective-c and iPhone api.不知道这是否会帮助我对objective-c和iPhone api有点陌生。
Maybe u can do something like this: Use the interface builder: just type "Interface Builder" on the Spotlight (top right corner) to generate like "myOptions.xib"也许你可以这样做:使用界面生成器:只需在聚光灯(右上角)上输入“界面生成器”即可生成“myOptions.xib”
And then just implement it: like然后就实现它:就像
@implementation myOptions
-(void)awakeFromNib
{
...
You can take a look at the QuartzDemo under the iPhone API to see how to load the interface list of objects.你可以看一下iPhone API下的QuartzDemo,看看如何加载接口对象列表。 In the previous view controller you just need to add it to the object list.
在之前的视图控制器中,您只需要将其添加到对象列表中。 It will look something like this:
它看起来像这样:
@implementation previousController
-(void)awakeFromNib
{
menuList = [[NSMutableArray alloc] init];
QuartzViewController *controller;
controller = [[QuartzViewController alloc] initWithTitle:@"Options"];
controller.quartzViewDelegate = [[[myOptions alloc] init] autorelease];
[menuList addObject:controller];
[controller release];
Hope it helps希望能帮助到你
Use the Interface Builder to open MainWindow.xib.使用 Interface Builder 打开 MainWindow.xib。 Add a new View to the XIB.
向 XIB 添加新视图。 Refer to the Interface Builder User Guide for more details.
有关更多详细信息,请参阅 Interface Builder 用户指南。
http://developer.apple.com/documentation/DeveloperTools/InterfaceBuilder-date.html#doclist http://developer.apple.com/documentation/DeveloperTools/InterfaceBuilder-date.html#doclist
While everyone has mentioned ways and pointers for displaying an additional view, if you are trying to solve your original problem of displaying application settings, you may want to use a settings bundle instead as per the Apple HIG for the iPhone虽然每个人都提到了显示附加视图的方法和指针,但如果您正在尝试解决显示应用程序设置的原始问题,您可能希望按照 Apple HIG for the iPhone 使用设置包
http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/MobileHIG/HandleTasks/chapter_6_section_4.html#//apple_ref/doc/uid/TP40006556-CH16-SW4 http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/MobileHIG/HandleTasks/chapter_6_section_4.html#//apple_ref/doc/uid/TP40006556-CH16-SW4
For how to do this, see this:有关如何执行此操作,请参阅:
http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ApplicationSettings/chapter_12_section_1.html#//apple_ref/doc/uid/TP40007072-CH13-SW10 http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ApplicationSettings/chapter_12_section_1.html#//apple_ref/doc/uid/TP40007072-CH13-SW10
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.