草庐IT

viewControllers

全部标签

iphone - iOS - 调用者 viewController 的引用

我在一个viewController中,我们称它为vcA,我称第二个为vcB,使用[selfpresentModalViewController:vcBanimated:YES];加载vcB后,是否有任何方法可以获取对vcA的引用?是的,我知道我可以子类化vcB并向其添加属性。我只是问是否有一些nativeiOS方法/属性/任何已经这样做的东西。我在navigationController应用上。谢谢。 最佳答案 如果它是单发使用并且没有太多协作,我倾向于使用block而不是委托(delegate),因为它看起来更整洁。例如,如果它

iOS Tabbar - 更改为第一个选项卡和第一个 ViewController

我需要一些有关我的Tabbar应用程序的帮助。目前我的Tabbar如下所示:标签栏Controller选项卡1导航ControllerViewController1ViewController2选项卡2ViewController3假设ViewController2是当前显示的ViewController。现在我切换到ViewController3并想以编程方式切换到ViewController1。问题是,因为Tab1中的事件ViewController是ViewController2[self.tabBarControllersetSelectedIndex:0];将始终切换到Vie

ios - 为什么 ViewController 的初始方向不是横向的,而应该是横向的?

我正在制作一个仅支持iOS设备横向模式的应用。所以我将它设置为仅对shouldAutorotateToInterfaceOrientation:中的UIInterfaceOrientationLandscapeRight和UIInterfaceOrientationLandscapeLeft返回YES,并在Info.plist到UIInterfaceOrientationLandscapeRight。该应用程序显示正常。问题是在View加载完成之前,坐标系不处于横向状态(我在这里不确定何时正确应用坐标系)。我所知道的是,它会在启动时调用:shouldAutorotateToInterf

iphone - iOS - 如何初始化 UINavigationController 以显示推送的 ViewController?

我想知道如何初始化UINavigationController以便在堆栈中显示第三个ViewController?有点像邮件应用程序。即使您终止了该应用程序,当您启动它时,您也会看到包含所有邮件的ViewController和“后退”按钮,可让您返回邮箱列表。感谢您的回答。 最佳答案 您可能需要查看UINavigationController的setViewControllers:animated:方法:ParametersviewControllersTheviewcontrollerstoplaceinthestack.Thef

ios - 为什么会出现 Modal ViewController :animated: Turn The Background Black?

我正在使用presentModalViewController:animated:,虽然它在功能上可以正常工作,但在视觉上它有一个我想删除的工件。当模态呈现的viewController出现时,其父viewController完全隐藏,背景变为黑色。这不是我想要的。我的子viewController的View是半透明的,我想显示其背后的父viewControllerView。我想要的效果是一张描图纸在背景上滑动。我假设presentModalViewController:animated:支持这个。不是这样吗?谢谢,道格 最佳答案

iphone - Push ViewController 带模态动画(水平翻转)

我需要将一个ViewController推送到另一个ViewController。menuVC->VC1->VC2从menuVC到VC1不需要动画,但是从VC1到VC2和从VC2到VC1需要翻转动画。但是,当从VC2转到menuVC时,不需要动画。我正在使用以下代码:(来自howtopushaviewControllerwithflipanimation)[UIViewbeginAnimations:nilcontext:nil];[UIViewsetAnimationDuration:1];[UIViewsetAnimationCurve:UIViewAnimationCurveEa

ios - 如何从 viewController 中删除边距?

我使用Storyboard创建了一个新项目。现在,我想将一个UIView添加到默认的ViewController中。当我尝试使用AutoLayout将约束添加到UIView及其父ViewController时,它在前导和尾随空间显示-16而不是0。这使得UIView小于默认的UIViewController宽度。我怎么能删除这个?请帮忙。 最佳答案 只需删除对margin选项的限制.. 关于ios-如何从viewController中删除边距?,我们在StackOverflow上找到一个

iphone - 结合 UITabBarController 和 UINavigationController

我尝试使用带有导航栏的“选项卡式应用程序”。默认情况下,选项卡栏工作正常,但我就是无法获得导航栏。我发现了一些关于插入导航栏和类似的东西,但我发现的所有东西都是几年前的,所以不要帮助我。而且最近的东西已经过时了,因为iOS5和新版本的Xcode..谁能指出我正确的方向来结合a来解决这个问题?请记住以下事实:我正在为iOS5开发我正在使用Xcode4.2 最佳答案 以下是如何以编程方式实现它。在[appName]-Info.plist中删除对主xib的引用在main.m中,加载你的委托(delegate):intretVal=UIAp

ios - 如何将 UITableView Cell 链接到 Storyboard 中的不同 ViewController

我已经创建了一个UITableView并设置了所有内容,以便它在表中提取我想要的正确数据。我唯一的问题是当我点击一个项目时,我希望它打开那个viewController我已经正确设置了StoryboardID,所以一切正常,但请查看下面的代码,以防我遗漏了一些明显的东西:-(void)tableView:(UITableView*)tableViewdidSelectRowAtIndexPath:(NSIndexPath*)indexPath{//Navigationlogicmaygohere.Createandpushanotherviewcontroller./**detailV

ios - UIPageViewController 的 viewController subview 动画转换

有没有办法制作动画UIPageViewController转换时的viewControllersubview?例如:我设置了UIPageViewController的过渡样式为滚动,导航为水平,书脊位置为屏幕底部。每个viewController的UIPageViewController有一个标签,我想在过渡时淡入或淡出。可以通过实现来实现非动画效果协议(protocol)。是否可以为标签的不透明度设置相对于手势的动画? 最佳答案 不幸的是,事实并非如此。委托(delegate)不提供任何获取滚动位置的方法。您必须推出自己的UIPa