uiviewcontroller

UIToolbar on each page of UINavigationController

为君一笑 提交于 2019-12-31 21:43:11
问题 I have an application which runs on a UINavigationController. Now I would like to add a UIToolbar element to the bottom of each screen. The Toolbar on the bottom should the be customizable for the ViewController that is currently being displayed. My first idea was to simply add the toolbar to the navigationController view and tag it, in the viewController I thought I would then be able to retrieve the UIToolbar element. I have the following code: In my AppDelegate: // Get instance of Toolbar

How to add right button in the navigation bar?

梦想的初衷 提交于 2019-12-31 21:37:50
问题 I have a question to add a right button in navigation bar.. I have two views: View A and View B I add a navigation bar to view A, after I used self.navigationController!.pushViewController to show view B. That show a back button in the left of navigation bar of view B automatic, it is good. but now I want to add a button in the right of navigation bar of view B.. I have tried some answers, but it doesn't work... I have tried answers likes : 1) https://www.hackingwithswift.com/example-code

How to add right button in the navigation bar?

浪尽此生 提交于 2019-12-31 21:37:09
问题 I have a question to add a right button in navigation bar.. I have two views: View A and View B I add a navigation bar to view A, after I used self.navigationController!.pushViewController to show view B. That show a back button in the left of navigation bar of view B automatic, it is good. but now I want to add a button in the right of navigation bar of view B.. I have tried some answers, but it doesn't work... I have tried answers likes : 1) https://www.hackingwithswift.com/example-code

Set view controllers property before pushViewController

对着背影说爱祢 提交于 2019-12-31 17:22:24
问题 In my app I've added a label to a view, connected it to an outlet but nothing shows up when I first assign this outlet from another view controller and then call pushViewController to display it. Here's the code before pushing next view that display the label: CustomViewController *vc = [[CustomViewController alloc] init]; vc.lbl_price.text = self.label_price.text; // lbl_price is defined as a property in CustomViewController and label_price is defined in current view controller [self

How to Remove a Previous ViewController

蓝咒 提交于 2019-12-31 10:40:29
问题 I am a student and pretty new to programming. I am trying to learn Objective-C/Swift in my spare time. I made a game using spriteKit with swift that has multiple menus/scenes. I am trying to transition from one view controller to another. To do this I used this code: @IBAction func PlayButtonPressed(sender: AnyObject) { let playStoryboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil) let vc : UIViewController = playStoryboard.instantiateViewControllerWithIdentifier("playGame") as

iOS 7 - Getting warning message while presenting modal view controller

筅森魡賤 提交于 2019-12-31 08:58:11
问题 Compiling and running using iOS 7 - I am getting warning message: "Presenting view controllers on detached view controllers is discouraged" while presenting modal view controller. I never had problem with iOS 6 or earlier version. Can anyone show if anything changed while presenting the modal view controller? SearchViewController *controller1; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { controller1 = [[SearchViewController alloc] initWithNibName:@"SearchViewController-iPad"

How to set up UITableView within a UIViewController created on a .xib file

那年仲夏 提交于 2019-12-31 08:49:05
问题 I have a class like this: @interface ExerciseLogDetails : UIViewController<UIActionSheetDelegate, UITableViewDelegate, UITableViewDataSource> { where I am trying to display some elements followed by a UITextView. The UITextView element is created on Interface Builder. When executing this code: - (void)viewDidLoad { self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain]; tableView.dataSource = self; tableView.delegate = self; [self.view addSubview

Complete list of transitions you can do between views on iPhone/ iPad [closed]

最后都变了- 提交于 2019-12-31 08:38:14
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . Are there many other resources for doing creative transitions between views? I am familiar with the following, but I am wondering if

how to dismiss a modal view controller presented as “Form Sheet” when a touch occur outside the form sheet?

我与影子孤独终老i 提交于 2019-12-31 08:31:55
问题 I have a View Controller (with a UIWebView) i present in Form Sheet style. I have to put a "Done" button in the UIToolbar of the view in the View Controller to have it dismissed. But, since presenting it in "Form Sheet" style leaves plenty of unused space outside the View Controller's view... I was wandering.. Is there a way to detect a touch outside the View? in that "grayed out" area? Thanks in advance 回答1: On iOS 4.2, the view hierarchy of a Navigation Controller based app with a modal

how to dismiss a modal view controller presented as “Form Sheet” when a touch occur outside the form sheet?

眉间皱痕 提交于 2019-12-31 08:30:12
问题 I have a View Controller (with a UIWebView) i present in Form Sheet style. I have to put a "Done" button in the UIToolbar of the view in the View Controller to have it dismissed. But, since presenting it in "Form Sheet" style leaves plenty of unused space outside the View Controller's view... I was wandering.. Is there a way to detect a touch outside the View? in that "grayed out" area? Thanks in advance 回答1: On iOS 4.2, the view hierarchy of a Navigation Controller based app with a modal