问题标签 [uinavigationcontroller]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2995 浏览

iphone - iPhone 仅在导航控制器下的特定屏幕上自动旋转

这只是我遇到的基本问题的一个例子,所以如果这种情况听起来有点毫无意义,请不要担心;)

假设我有一个主要是 UINavigationController 的应用程序,只有两层深。顶层是一个包含图像文件名列表的表格,第二层只有一个 UIImageView 显示您点击的文件名的图像。

对于这样的应用程序,有没有人知道一种让顶层表格自动旋转同时保持第二层图像固定在纵向模式的好方法?

到目前为止,我几乎可以到达那里......但是当我在横向模式下点击文件名时,即使二级视图控制器的 shouldAutorotateToInterfaceOrientation 仅针对纵向模式返回 yes,图像也会以错误的方向滑入视图。

0 投票
1 回答
1509 浏览

uinavigationcontroller - 使用 UINavigationController 自动旋转

我有点不清楚如何旋转 UINavigationController 上的视图。

我已经用我自己的一个覆盖了 UINavigationController 对象:

  • (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { return YES; }

我在控制器上的堆栈上有一个视图,该视图是从带有两个视图的 xib 加载的。我想从纵向切换到横向。通常我会通过从视图本身的 nib 文件中更改视图来处理这个问题。我是否必须在导航控制器中或仅在我的视图代码中实现旋转代码?

  • (void)willAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 持续时间:(NSTimeInterval)duration

那 willAnimate 代码是我习惯在视图本身中使用的代码,但我仍然没有看到视图被更改,我想可能是我需要访问 NavigationController 中的视图并更改它,甚至覆盖导航控制器中的相同方法并在那里切换我的视图。

有什么建议么?我以前从未真正这样做过,只是发现 TabViewControllers 和 NavigationControllers 在默认情况下都是纵向模式。

0 投票
6 回答
11352 浏览

iphone - iPhone:UINavigationController 顶部的奇怪空间

我在将 UINavigationController 添加到我的 iPhone 应用程序时遇到了一个奇怪的问题。我添加控制器如下:

一切似乎都按计划进行,除了在状态栏和 UINavigationController 标题栏之间的视图顶部出现一个奇怪的空白。 替代文字 http://www.andrewskinner.name/problem.png

我在网上搜索过,但真的不知道要搜索什么。有没有其他人有这个问题?你能给我指明一些帮助的方向吗?

提前致谢。

0 投票
2 回答
4239 浏览

iphone - Using sleep within iPhone apps (esp. with UINavigationController)

I'm pretty new to iPhone development but I'm close to releasing my first app (related to a website I run). The app requires a very large database and as such I've decided to store only the most commonly used data locally, retrieving the other data via a JSON web service call from the database my website runs off.

Whilst performing OK using the simulator (hitting the live DB) searches relying on the web service call have been taking longer than I'd have hoped they would when running on the phone. These calls look much worse when compared to the native searches which are instantaneous. To reduce the relative difference I wanted to put in a fake interstitial (page with activity indicator) for the native searches (the web service searches already use one) but I've been having an issue with the timing of navigation controller pushes when combined with sleep(n).

Anyway, the search section of my app is a navController wihin a tabController tab. When trying to use code like this:

I find that the push always waits for the sleep to finish before executing when the effect I want is for the viewcontroller to be pushed and then the app to wait for two seconds before continuing to simulate the search process.

I've had some other weird results with navController pushes, on a few occasions I've experienced what seems to be a mashing of two separate viewcontrollers when the one I've pushed as interstitial remains in place content-wise with only the title of the one I want pushed in it's place remaining.

I'm sure that there is a fundamental lack of understanding on my part to blame so I'm hoping for a bit of guidance here.

Cheers,

Alan.

0 投票
1 回答
2850 浏览

iphone - 为什么 initWithRootViewController 不保留传入的 viewController 类?

我有一个名为 SourceListViewController 的自定义 viewController,我将它添加到 UINavigationController 中,然后将其视图添加到 iphone App 的窗口中。在将 SourceListViewController 传递给 UINavigationController 之后,我释放了 sourceListViewController。

当我这样做时,应用程序会在视图加载到手机后崩溃。当我注释掉最后一行时,该应用程序运行良好。initWithRootViewController 不应该保留 sourceListVC 的副本吗?

0 投票
2 回答
8957 浏览

iphone - 我可以提高 presentModalViewController 的动画速度吗?

我正在编写一个绘图应用程序,当用户单击工具栏中的项目时,它会显示一个工具视图控制器。但是,我的几个 Beta 测试人员报告说,这些工具的口味打开得太慢了。我正在使用标准的 presentModalViewController:animated: 调用来显示工具,并且我尝试将它包装在这样的代码块中以加快速度:

不幸的是,这不起作用。如果你说 animated:NO 效果更好,但底层的绘图画布视图会立即被删除(因为控制器认为它不再可见),因此动画会在白色背景上发生。

在此之前有没有人愿意提供一些建议?我会很感激的!

0 投票
3 回答
2649 浏览

iphone - UITabBarController、UINavigationController 和自动旋转

我在 iphone 上自动旋转有问题

我在所有课程中设置

但它没有响应;/

示例代码是:http ://b6.s3.p.quickshareit.com/files/testautorotatecb367.zip

问题仅出在第一个选项卡上,如果我将应用程序切换到第二个选项卡并旋转 iphone,界面正在旋转。它没有在 TAB1 中旋转,我在其中放置了自定义 UINavigationController

0 投票
2 回答
567 浏览

iphone - UINavigationController - same viewController

I have an app where I'm trying to recursively load views. So I have one view (theViewController) that is able to drill down into another view of the same type (theViewController). I have the recursion working fine and the back buttons work just fine. But I'm trying to implement a function that does some work and then unloads the current view.

In another spot in my code I have the following:

It is also at the end of a function that does some work for that view (theSecondViewController), but it loads a different view (theViewController).

My problem is when I use this SAME code in my theViewController it breaks down. Well, kind of. I think it goes through and does pop the controller off, but when it tries to reload the view (theViewController) to the left of it (above it, however you want to think about it) it dies. Once in a blue moon it will spit out:

But usually it just dies without errors (at least I think thats what this stuff is):

Any help in understanding why it might die on reloading a page would be very helpful.

Update: If there was an error with the nib wouldn't an issue come up earlier? I believe that it is correct. I'm just not sure where the code is going after [navigationController popViewControllerAnimated:YES]; I thought it would go to the next view's viewDidLoad. But I have a NSLog message there and its not showing up.

The navigation I can do thus far is this:

If its straight in and straight out it works fine. The code above works in theSecondViewController but not theViewController

0 投票
2 回答
1118 浏览

iphone - MKMapView 中的错误?

当我在新视图中使用导航控制器打开 MapView 时,不等到地图加载,然后单击后退按钮 - 我抛出异常。谁能证实这一点?什么是变通方法?

0 投票
1 回答
841 浏览

iphone-sdk-3.0 - uiview 动画过去可以在 iphone sdk 2.2 上运行,现在它不能在 sdk 3.0 上运行

在 iphone OS 2.2 上运行应用程序时,我有一个运行良好的动画块。现在我为 iphone OS 3.0 编译了相同的代码,但它不起作用。

代码的作用是,它使用导航控制器来更改最顶层的视图,但使用的是翻转过渡而不是内置的。

关于 sdk 中可能发生的变化或我做错了什么的任何想法?

谢谢!!