简体   繁体   English

如何向我的 iphone 应用程序添加额外的“视图”?

[英]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.

相关问题 如何在iPhone应用程序中为此自定义视图转换设置动画? - How can I animate this custom view transition in my iPhone app? 如何在iPhone应用程序中使用2选择器视图? - How can i use 2 picker view in my iPhone app? 当用户单击“添加到主屏幕”时,是否可以向iPhone定位的Web应用程序添加其他内容? - Can I add additional content to my iPhone-targeted web app when the user clicks on “add to home screen”? 如何在Xcode中将js代码添加到我的iPhone应用程序 - how can i add a js code to my iphone app in xcode 我想在我的iPhone应用程序中添加撤消按钮,我该怎么做? - i want to add the undo button in my iphone app, how can i do this? 如何在不引入View或Tab控制器的情况下将核心位置数据集成到我的空白iPhone App中? - How can I integrate core location data to my blank iPhone App without introducing View or tab controller? 如何在越狱的iPhone上测试iPhone应用程序? - How can I test an iPhone app on my iPhone that is Jailbroken? 如何在iPhone应用程序的UI中添加自定义视图? - How do I add a custom view to iPhone app's UI? 如何在我的iPhone应用程序中添加两个启动屏幕? - How can I add two splash screen's in my iPhone app? 如何在iPhone应用程序的键盘上添加一个图标,该图标会隐藏键盘? - How can I add an icon to the keyboard in my iPhone app, that would hide the keyboard?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM