uistoryboard

AutoLayout: UIView within UIView has incorrect frame

一曲冷凌霜 提交于 2019-11-30 15:37:27
问题 I am working with AutoLayout in Storyboard, and everything seemed to be going fine. However, when I put one UIView within another and apply all the constraints I want to both the container and its children, I notice that the frame is incorrect in viewDidLayoutSubviews: . Rather than being the frame I would expect to be calculated given my constraints, it is some disgustingly large frame (albeit at the correct origin). For example, rather than a frame of {{26, 10}, {444, 10}} I get something

Getting subViews' frames in Storyboard

余生颓废 提交于 2019-11-30 15:31:38
I just want (for now) to get the dimensions of a subview on the view controller's instantiation. [This is a reduction to as simple a case I can find of a previous question . I am trying to figure out why subViews of scenes in Storyboards are not behaving the way I expect, which is to say: like XIBs do - I just want to get dimensions of my subviews before anything is actually drawn to the screen] To condense the problem down to a new, clean project, I do this: create a new, single view project with "using Storyboard" checked add a single UIView to the default existing MainStoryboard_iPad

Why isn't initWithCoder initializing items correctly?

穿精又带淫゛_ 提交于 2019-11-30 14:36:03
问题 I've got a subclass of UITableViewCell . My subclass contains several UILabel s. I want my subclass to initialize these labels to some default settings that applies to every table view cell of mine. I read that I should be using initWithCoder for this. My initWithCoder function is being called, and I can step through each line in my function and it appears to go through the motions. When I run my application I do not see any of the properties being applied, though. Most noticeably, the font

iOS - best practice for managing code merge in a storyboard

一个人想着一个人 提交于 2019-11-30 14:28:42
问题 Merging in a xcode storyboard with many team members can produce many conflicts etc. I need a strategy to share a storyboard with 20 team members but to avoid the nightmares associated with merging code in a storyboard. I thought of having a separate target per team in xcode but this doesn't do well as we all need the updates so having two story boards is not good practice. my code base is inherited. its a forked project that is storyboard heavy already. I think changing to xib might be

Xcode Localization is driving me nuts! Not loading Storyboard

独自空忆成欢 提交于 2019-11-30 12:16:28
问题 It's been 2 days this issue is driving me nuts. I'm trying to localize my iOS app but for the life of me I can't get it to work. It works easy enough when I try on a blank project but not on my current project. I've added the languages in the Localizations using "+", I've localized the storyboard but when I check on simulator or device I still see the english version. And in fact it's not even the English one because if I change the Maintsoryboard (english) I don't see the changes in the

Cannot Connect Storyboard Unwind Segue

…衆ロ難τιáo~ 提交于 2019-11-30 11:54:39
问题 I am attempting to create an unwind segue but nothing will connect to it when ctrl+dragging. Also when I right click on the Exit icon there are no options available. Any ideas? 回答1: You need to have an IBAction defined on a view controller that takes an argument of type "UIStoryboardSegue *". Something like this: @interface MyViewController ... - (IBAction)unwindFromConfirmationForm:(UIStoryboardSegue *)segue { } ... @end Swift 3 Version @IBAction func unwindToViewController(segue:

Uppercase characters in UItextfield

跟風遠走 提交于 2019-11-30 11:44:19
问题 I have a question about iOS UIKeyboard . I have a UITextField and I would to have the keyboard with only uppercase characters. I use a storyboard and I tried to set the Cpitalization as " All characters " to UITextField properties . But this not solve my problem...any suggestion? 回答1: Set your textfield type autocapitalizationType to UITextAutocapitalizationTypeAllCharacters on the UITextField self.yourTexField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters; After call

Multiple views in Xcode storyboard view controller, one of them won't appear in storyboard editor

╄→尐↘猪︶ㄣ 提交于 2019-11-30 11:32:09
I'm having trouble updating a project someone else created in Xcode. This is an app built in storyboard and in one case, there is a scene with a view controller that has multiple views underneath it in the document outline palette of the storyboard editor (shown in included image). The first view is the one that becomes highlighted in the storyboard editor when it is clicked on, and as you change the design or the objects in the view that view is updated. There is a second view (the one beneath exit and first responder) that is somehow attached to that scene but I cannot figure out how to edit

ios pass values during a segue to another view

断了今生、忘了曾经 提交于 2019-11-30 11:21:44
问题 Trying to do something I've seen documented in a lot of places, but can't seem to manage. I'm trying to pass data from one view to another during a segue. Here's the prepareForSegue method in the source view: - (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { //pass values DetailViewController *dest = (DetailViewController *)[segue destinationViewController]; dest.locTitle = [value valueForKeyPath:@"title"]; dest.locInfo = [value valueForKeyPath:@"info"]; // NSLog(@"The

Make button it UIAlertView perform Segue

时光总嘲笑我的痴心妄想 提交于 2019-11-30 09:17:33
I have created a UIAlertView for an action which gives me 2 options. I want the user to be able to click on a button and have it perform a Segue. Here's the code I have so far: - (IBAction)switchView:(id)sender { UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"Please Note" message:@"Hello this is my message" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Option 1", @"Option 2", nil]; [myAlert show]; } - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { NSString *buttonTitle = [alertView buttonTitleAtIndex:buttonIndex]; if (