uiviewcontroller

Child content view controller view has wrong bounds size from Storyboard?

筅森魡賤 提交于 2019-12-21 17:07:32
问题 This document outline from my sample Storyboard shows what I'm working with. I have a custom container view controller and two content view controllers connected via embed segues. Here is the storyboard itself. ZetaViewController has to create some programmatic views (within ZetaView, of course). I noticed when I was centering these programmatically created views they seemed really off center. ZetViewController is centering things by examining self.view.bounds.size.height and self.view.bounds

UIViewController with Nib File and Inheritance

蓝咒 提交于 2019-12-21 16:52:26
问题 I'm trying to do something really tricky and I'm still stuck at a point. I'm attempting to instance an UIViewController with a Nib file inherited from an other UIViewController with an other Nib file. The problem is when I instantiate my son UIViewController . // SonViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { // Custom initialization. } return self; } The init

Storyboard - Position is ambiguous for “Round Style Text Field” Warning

蹲街弑〆低调 提交于 2019-12-21 16:49:08
问题 https://stackoverflow.com/a/16251810/2589276 I solved the problem above but got a new problem when I did the steps I was instructed to. Now I get a warning saying: Position is ambiguous for "Round Style Text Field" I tried setting fixed constraint for width also, but did not fix this warning. Any ideas? Are there any other information I should give for this problem? This screen shot when I do add constraint to x, leading space constraint (for x) and vertical space constraint from the bottom.

How do I change the UINavigationController push transition style?

Deadly 提交于 2019-12-21 12:39:29
问题 I am using a navigation controller and push segues to control the flow of my app. Is there anyway to change the default animation of right-to-left for the push segues? Is there something I can overwrite somewhere? Thanks 回答1: I did the following and it works fine.. and is simple and easy to understand.. CATransition* transition = [CATransition animation]; transition.duration = 0.5; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];

Slow UIViewController load time (slow ClientState warning)

£可爱£侵袭症+ 提交于 2019-12-21 12:33:39
问题 Since I converted an old app to iOS 6 I've started getting the following message in my console. WARNING: Slow defaults access for key ClientState took 0.023656 seconds, tolerance is 0.020000 Other than updating my code from iOS 5 to iOS 6, I also switched over to auto-layout. I've run Instruments/Time Profiler and the rootViewController in my appDelegate is the problem. Everytime I switch view controllers it sucks the vast major of the time, (regardless of whether I have to instantiate the

backBarButtonItem gets renamed in iOS 7 when there is a long title

☆樱花仙子☆ 提交于 2019-12-21 09:15:05
问题 One behavior I observed in iOS 7 is that the title of the backBarButtonItem of a UINavigationItem get's renamed if the title of the currently displayed view controller is too long. Too lazy to explain so here are some photos: As you can see, when the title is too long, the back button gets renamed to "Back" regardless of what it was previously. If the title is even longer, the back button doesn't show any text, just the left arrow image. Does anyone know how to disable this behavior? I would

How to subclass custom UIViewController in Swift?

試著忘記壹切 提交于 2019-12-21 09:03:37
问题 I'd like to create a reusable view controller UsersViewControllerBase . UsersViewControllerBase extends UIViewController , and implements two delegates ( UITableViewDelegate , UITableViewDataSource ), and has two views ( UITableView , UISegmentedControl ) The goal is to inherit the implementation of the UsersViewControllerBase and customise the segmented items of segmented control in UsersViewController class. class UsersViewControllerBase: UIViewController, UITableViewDelegate,

How to dismiss 2 view controller in swift ios? [closed]

邮差的信 提交于 2019-12-21 07:56:29
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . How to dismiss 2 view controllers in Swift iOS? Below is my code. @IBAction func backButtonTapped(sender: AnyObject) { self.presentingViewController .presentingViewController .dismissViewControllerAnimated(true, completion: nil) } 回答1: Swift 3+ version. You can dismiss two view controllers at a time in Swift 3

cannot update view.layer.frame in viewDidLoad?

一笑奈何 提交于 2019-12-21 07:26:40
问题 I am trying to execute following code in viewDidLoad method of my single view controller project: self.view.layer.frame = CGRectInset(self.view.layer.frame, 20, 20); But it does not give the desired inset. However other UI changes i make in the same method do work e.g self.view.layer.backgroundColor = [UIColor orangeColor].CGColor; Above line of code does work and background is change to orange but the frame does not. The inset works only if I place the line of code in viewDidAppear. I would

cannot update view.layer.frame in viewDidLoad?

蓝咒 提交于 2019-12-21 07:26:08
问题 I am trying to execute following code in viewDidLoad method of my single view controller project: self.view.layer.frame = CGRectInset(self.view.layer.frame, 20, 20); But it does not give the desired inset. However other UI changes i make in the same method do work e.g self.view.layer.backgroundColor = [UIColor orangeColor].CGColor; Above line of code does work and background is change to orange but the frame does not. The inset works only if I place the line of code in viewDidAppear. I would