uistoryboard

How to Segue Randomly to ViewControllers in Swift? [closed]

旧巷老猫 提交于 2019-11-28 02:15:41
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . For my Swift app, I'm trying to make it so that a button will lead to a random page in my Main.storyboard but I'm not sure if such a method exists. Is there a way for me to do this? 回答1: Here is how you can segue to a random ViewController . For my example, I chose to use a

How to set one of the screens in landscape mode in iphone?

狂风中的少年 提交于 2019-11-28 01:45:40
I am developing iphone application in iOS7, i am facing problem in autorotate single screen in landscape mode programatically, while other screens remains in portrait mode. I am using Story board. I used following and its working for me in both iOS6 and iOS7 also,try following way : // Added method for Autorotation in you app delegate - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ //NSLog(@"AppDelegate -- supportedInterfaceOrientationsForWindow"); if([UICommonUtils isiPhone]){ return UIInterfaceOrientationMaskPortrait; }else

How to know the current storyboard name?

对着背影说爱祢 提交于 2019-11-27 23:39:23
问题 I want to know what is the current loaded storyboard,I used the below code but it is still get me the Main storyboard not the current. //This get me the Main storyboard [[NSBundle mainBundle].infoDictionary objectForKey:@"UIMainStoryboardFile"]; 回答1: If you are working in a UIViewController class that is instantied or segues through the storyboard the most simple way is : UIStoryboard *storyBoard = self.storyboard; If you are in a UIView class that is in a UIViewController UIResponder

Font color for UILabel not changing

佐手、 提交于 2019-11-27 23:20:25
问题 I am trying to display numbers on a UILabel with a bold black font and size 50. After some failed attempts I just realized that no matter what color I set the font to, it always gets set to lightGray. Is there something else I need to do other than the below? [DisplayLabel setFont:[UIFont fontWithName:[NSString stringWithUTF8String:"HelveticaNeue-Bold"] size:50]]; DisplayLabel.textColor = [UIColor brownColor]; DisplayLabel.textAlignment = NSTextAlignmentCenter; I am adding the label using the

How do I connect a IBOutlet to a UIView?

微笑、不失礼 提交于 2019-11-27 22:38:07
问题 I'm trying to switch views after an animation as seen: [UIView beginAnimations: @"Fade Out" context:nil]; [UIView setAnimationDelay:1.0]; [UIView setAnimationDuration:0.25]; splash.alpha = 0.0; [UIView commitAnimations]; [self.view addSubview : view]; At the [self.view addSubview : view]; I have to add a name for the view for it to add, so I made an IBOutlet like so: (on the first view controller's .h file) IBOutlet UIView *main; But when I try to connect the *main UIView to the view on the

How to create a UIViewController layout in storyboard and then use it in code?

天大地大妈咪最大 提交于 2019-11-27 21:18:56
问题 I have a Storyboard in my iOS 5 application. In there I have created a number of screens and it works perfectly. However there's one view controller that I create in code, not as a result of UI action but at the end of processing data. I would like to show this view controller then, as a modalViewController, but also have it designed in the storyboard editor. Is it possible? Using the nibs I did it like this: ResultsController *rc = [[ResultsController alloc] initWithNibName:@

Change the listing order of the view controllers in Xcode storyboard

北战南征 提交于 2019-11-27 20:53:35
问题 I'm just starting my first application using storyboards. I'm using Xcode 4.5 and iOS 6 SDK. I want to know how to change the order in which the controllers are listed in the Document Outline (panel to the left of the storyboard). 回答1: In the Document Outline, drag the orange view controller icon. As you do this you will see the blue horizontal insertion point appear between the grey boxes. Let go and the whole grey group box for the view controller will relocate. 回答2: In Xcode 11 you just

Xcode storyboard: Internal error. Please file a bug

烂漫一生 提交于 2019-11-27 19:59:01
问题 While editing in the storyboard, specifically assigning a view controller to a specific class, I suddenly encountered this error when I wanted to run the project. Main.storyboard: Internal error. Please file a bug at bugreport.apple.com and attach "/var/folders/79/_jh611t15qsfcx165_jv_20h0000gn/T/IB-agent-diagnostics_2015-10-28_00-33-12_730000". And now I can't run my project anymore. I couldn't find any information regarding to this anywhere else. Did anyone encounter this before? 回答1: I

AutoLayout multiline UILabel cutting off some text

╄→尐↘猪︶ㄣ 提交于 2019-11-27 18:46:08
I'm trying to learn auto layout, finally thought I was getting the hang on it when this happened. I'm playing about with prototype cells and labels. I'm trying to have a Title, titleLbl - blue box in picture Money, moneyLbl - green box in picture Subtitle / Description, subTitleLbl - red box in picture So far I have this: What I want to achieve is: The green box should always display on 1 line fully The value inside the green box should be centred based on the blue box The blue box will take the remaining space (-8px for horizontal constraint between the 2) and display on multiple lines if

How to Perform Segue With Delay

送分小仙女□ 提交于 2019-11-27 17:46:56
问题 In my storyboard, I have a view as a splash screen. In this view, I already have a button like "Open Application" that is opening the menu view with a modal segue. But I also want screen to perform segue automatically, like after 2 seconds view appears. Some code here: - (void)viewDidAppear:(BOOL)animated { [self performSegueWithIdentifier:@"splashScreenSegue" sender:self]; } As you can see, I already use performSegueWithIdentifier but it performs immediately. Is there a method to make it