草庐IT

NavigationController

全部标签

ios - 如何在 Swift 中弹出特定的 View Controller

我使用下面的Objective-C代码来弹出一个特定的ViewController。for(UIViewController*controllerinself.navigationController.viewControllers){if([controllerisKindOfClass:[AnOldViewControllerclass]]){//DonotforgettoimportAnOldViewController.h[self.navigationControllerpopToViewController:controlleranimated:YES];break;}}我

ios - 如何在 Swift 中弹出特定的 View Controller

我使用下面的Objective-C代码来弹出一个特定的ViewController。for(UIViewController*controllerinself.navigationController.viewControllers){if([controllerisKindOfClass:[AnOldViewControllerclass]]){//DonotforgettoimportAnOldViewController.h[self.navigationControllerpopToViewController:controlleranimated:YES];break;}}我

ios - 如何在向下滚动时隐藏导航栏和工具栏? Swift(如 myBridge 应用程序)

我想在向下滚动页面时隐藏工具栏和导航栏。当我向上滚动时返回它。这怎么可能?我将如何检测阻力?我是使用平移手势还是使用ScrollView向下? 最佳答案 试试这个简单的方法:在Swift3中测试funcscrollViewWillEndDragging(_scrollView:UIScrollView,withVelocityvelocity:CGPoint,targetContentOffset:UnsafeMutablePointer){if(velocity.y>0){//Codewillworkwithouttheanima

ios - 如何在向下滚动时隐藏导航栏和工具栏? Swift(如 myBridge 应用程序)

我想在向下滚动页面时隐藏工具栏和导航栏。当我向上滚动时返回它。这怎么可能?我将如何检测阻力?我是使用平移手势还是使用ScrollView向下? 最佳答案 试试这个简单的方法:在Swift3中测试funcscrollViewWillEndDragging(_scrollView:UIScrollView,withVelocityvelocity:CGPoint,targetContentOffset:UnsafeMutablePointer){if(velocity.y>0){//Codewillworkwithouttheanima

iOS 11 更喜欢 LargeTitles 在滚动之前不更新

我使用包装在UINavigationController中的UITableView实现了一个基本的UIViewController。我将prefersLargeTitles设置为true:overridefuncviewDidLoad(){super.viewDidLoad()//Doanyadditionalsetupafterloadingtheview,typicallyfromanib.navigationController?.navigationBar.prefersLargeTitles=truenavigationItem.title="Coffees"}但是,在我Sc

iOS 11 更喜欢 LargeTitles 在滚动之前不更新

我使用包装在UINavigationController中的UITableView实现了一个基本的UIViewController。我将prefersLargeTitles设置为true:overridefuncviewDidLoad(){super.viewDidLoad()//Doanyadditionalsetupafterloadingtheview,typicallyfromanib.navigationController?.navigationBar.prefersLargeTitles=truenavigationItem.title="Coffees"}但是,在我Sc

ios - Swift——在 App Delegate 中实例化一个没有 Storyboard的导航 Controller

我正在重建一个没有Storyboard的应用程序,其中我遇到最大麻烦的部分是以编程方式导航View到View。那里写的东西很少不使用Storyboard,因此很难找到答案。我的问题很简单。我有我的ViewController和我的SecondViewController,我想从前者推送到后者。在AppDelegate中:funcapplication(application:UIApplication,didFinishLaunchingWithOptionslaunchOptions:[NSObject:AnyObject]?)->Bool{//Overridepointforcus

ios - Swift——在 App Delegate 中实例化一个没有 Storyboard的导航 Controller

我正在重建一个没有Storyboard的应用程序,其中我遇到最大麻烦的部分是以编程方式导航View到View。那里写的东西很少不使用Storyboard,因此很难找到答案。我的问题很简单。我有我的ViewController和我的SecondViewController,我想从前者推送到后者。在AppDelegate中:funcapplication(application:UIApplication,didFinishLaunchingWithOptionslaunchOptions:[NSObject:AnyObject]?)->Bool{//Overridepointforcus

objective-c - 在 iOS 7 中自定义导航栏 - 标题颜色不起作用

我正在尝试自定义iOS7中导航Controller的导航栏,但标题颜色没有改变。我正在做以下事情:[navigationController.navigationBarsetBarTintColor:[UIColorcolorWithRed:46.0f/256.0fgreen:46.0f/256.0fblue:46.0f/256.0falpha:1]];[navigationController.navigationBarsetTranslucent:NO];[navigationController.navigationBarsetTitleTextAttributes:@{[UIC

objective-c - 在 iOS 7 中自定义导航栏 - 标题颜色不起作用

我正在尝试自定义iOS7中导航Controller的导航栏,但标题颜色没有改变。我正在做以下事情:[navigationController.navigationBarsetBarTintColor:[UIColorcolorWithRed:46.0f/256.0fgreen:46.0f/256.0fblue:46.0f/256.0falpha:1]];[navigationController.navigationBarsetTranslucent:NO];[navigationController.navigationBarsetTitleTextAttributes:@{[UIC