草庐IT

Viewcontroller

全部标签

ios - 按键盘上的返回键时的 Action (iOS)

-(BOOL)textFieldShouldReturn:(UITextField*)textField{[selfcheckRun:nil];returnYES;}我试图通过使用上面的代码在按下返回键时完成IBActioncheckRun,但它似乎不起作用。我哪里错了?我想可能是因为我没有直接引用我正在输入的文本字段,但我无法弄清楚我需要在哪里放置该文本字段的名称。提前致谢。 最佳答案 ViewController.h:#import@interfaceViewController:UIViewController@endView

ios - 如何使用 swift 将 google places autocomplete 添加到 xcode(教程)

我想使用swift将googleplacesautocomplete添加到xcode,这样用户就可以搜索城市并按enter键,所以应用程序应该在map上显示该城市。我使用的是谷歌地图,所以它必须连接到该map,我希望导航栏中有搜索栏(就在map上方)有人知道这样做的好教程吗? 最佳答案 对于swift3:1-选择您的podfile并输入:pod'GooglePlaces'2-在appDelegate中,添加您的APIkey:GMSPlacesClient.provideAPIKey("YOURKEY")(导入GooglePlaces

ios - 如何使用 swift 将 google places autocomplete 添加到 xcode(教程)

我想使用swift将googleplacesautocomplete添加到xcode,这样用户就可以搜索城市并按enter键,所以应用程序应该在map上显示该城市。我使用的是谷歌地图,所以它必须连接到该map,我希望导航栏中有搜索栏(就在map上方)有人知道这样做的好教程吗? 最佳答案 对于swift3:1-选择您的podfile并输入:pod'GooglePlaces'2-在appDelegate中,添加您的APIkey:GMSPlacesClient.provideAPIKey("YOURKEY")(导入GooglePlaces

iphone - 在 Storyboard 中隐藏一个 ViewController 的 NavigationBar

找了很多帖子,还是没有解决办法。我试图在初始UIViewController上隐藏NavigationBar,但我仍想在第二个UIViewController上显示它。这是我的Storyboard:当我关闭主视图Controller的推断顶部栏时,它会在Storyboard中消失,但在我运行应用程序时它仍然会显示。当我对NavController中的NavigationBar执行相同操作时,它对所有三个都消失了(因为它们都继承了无导航栏)。我想在ScrollViewVViewController中显示NavBar,但将其隐藏在MainViewController中。所有Controll

iphone - 在 Storyboard 中隐藏一个 ViewController 的 NavigationBar

找了很多帖子,还是没有解决办法。我试图在初始UIViewController上隐藏NavigationBar,但我仍想在第二个UIViewController上显示它。这是我的Storyboard:当我关闭主视图Controller的推断顶部栏时,它会在Storyboard中消失,但在我运行应用程序时它仍然会显示。当我对NavController中的NavigationBar执行相同操作时,它对所有三个都消失了(因为它们都继承了无导航栏)。我想在ScrollViewVViewController中显示NavBar,但将其隐藏在MainViewController中。所有Controll

ios - 在 iOS 7 的 UINavigationController 上推送 View 时如何交叉融合?

如果我简单地调用push方法:[self.navigationControllerpushViewController:viewControlleranimated:YES];然后它使用推送动画。我如何更改它以使用交叉溶解动画,就像我可以使用模态转场一样? 最佳答案 我使用扩展以便于重用:extensionUINavigationController{funcfadeTo(_viewController:UIViewController){lettransition:CATransition=CATransition()transi

ios - 在 iOS 7 的 UINavigationController 上推送 View 时如何交叉融合?

如果我简单地调用push方法:[self.navigationControllerpushViewController:viewControlleranimated:YES];然后它使用推送动画。我如何更改它以使用交叉溶解动画,就像我可以使用模态转场一样? 最佳答案 我使用扩展以便于重用:extensionUINavigationController{funcfadeTo(_viewController:UIViewController){lettransition:CATransition=CATransition()transi

objective-c - iOS:警告:在演示过程中尝试在 <ViewController> 上呈现 <ModalViewController>

我试图在从图像选择器中选择图像后创建模态视图Controller。我使用代码:-(void)imagePickerController:(UIImagePickerController*)pickerdidFinishPickingMediaWithInfo:(NSDictionary*)info{NSLog(@"Pickerhasreturned");[selfdismissModalViewControllerAnimated:YES];//TODO:makethisallthreaded?//croptheimagetotheboundsprovidedimg=[infoobje

objective-c - iOS:警告:在演示过程中尝试在 <ViewController> 上呈现 <ModalViewController>

我试图在从图像选择器中选择图像后创建模态视图Controller。我使用代码:-(void)imagePickerController:(UIImagePickerController*)pickerdidFinishPickingMediaWithInfo:(NSDictionary*)info{NSLog(@"Pickerhasreturned");[selfdismissModalViewControllerAnimated:YES];//TODO:makethisallthreaded?//croptheimagetotheboundsprovidedimg=[infoobje

ios - 呈现多个模态视图 Controller ?

更新:我又遇到了这个问题,找到了另一种方法。如果呈现Controller没有嵌入到导航Controller中,如果呈现的Controller不是全屏,它将被隐藏并变成黑色。方法setModalPresentationStyle:UIModalPresentationCurrentContext只能应用于导航Controller。因此,在UINavigationController中嵌入呈现Controller,为其设置UIModalPresentationCurrentContext并呈现新Controller-您将获得对话框Controller。我正在展示搜索Controller,它