如何在没有导航控制器的iPhone中更改按钮点击视图? [英] How to change view on button click in iPhone without navigation controller?

查看:126
本文介绍了如何在没有导航控制器的iPhone中更改按钮点击视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在没有导航控制器的情况下如何在iPhone上更改按钮点击视图?

I want to know how to change view on button click in iPhone without navigation controller?

推荐答案

如果你正在做使用UIViewController,您可能会执行以下操作:

If you're doing this with a UIViewController, you would probably do this like following:

- (IBAction)change {
    UIViewController* viewController = [[UIViewController alloc] init];
    [self.view addSubView];
    // Save the UIViewController somewhere if necessary, otherwise release it
}

不知道为什么你不想使用UINavigationController。如果它是您不想看到的顶部的导航栏,则有一个属性,以便您可以隐藏该栏。不确定它的名字,可能是navigationBarHidden或类似的东西。你可以在API中查找。

Not sure why you don't want to use a UINavigationController though. If it's the navigation bar at the top you don't want to see, there's a property for that so you can hide that bar. Not sure about it's name, probably navigationBarHidden or something like that. You can look that up in the API.

这篇关于如何在没有导航控制器的iPhone中更改按钮点击视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆