uistoryboard

iOS Container View doesn't honour intrinsicContentSize

烈酒焚心 提交于 2019-11-30 02:26:19
I want to use a Container View to contain a camera preview. I want the camera to centered in the middle and maintain it's proper aspect ratio. (it's pink to make it obvious where its frame is) I'm stuck on the first step of trying to get the camera preview to appear at a size that's smaller than the container. I have a UIView subclass for the Camera Controller's view, and have the code: - (CGSize)intrinsicContentSize { return CGSizeMake(320, 240); } Unfortunately this isn't honoured: From reading the docs, intrinsicContentSize looks like it's what I want. Eventually I want to use Auto Layout

XCode custom segue class stuck

南楼画角 提交于 2019-11-30 02:24:05
问题 this question might seem a little weird, but I can't wrap my head around why this is happening. What I did was I renamed a custom segue class, and reflected it in the storyboard under 'custom class', but it still tries to call the old one. I have cleaned the build folder and searched the project for the old custom class name and it does not find anything in xcode at least. I look inside the storyboard file, it's not there either. Even if I delete the custom segue all toghether I get: 'Could

Cannot Connect Storyboard Unwind Segue

蓝咒 提交于 2019-11-30 02:03:27
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? Jon Hess 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: UIStoryboardSegue) { //code } Provided by DoruChidean in https://stackoverflow.com/a/46199117/250190 Travis M

How to use dismiss an iPhone popover in an Adaptive Storyboard

点点圈 提交于 2019-11-30 01:50:39
问题 I am new to iOS development, and am trying to learn storyboarding, Swift, and the new features of iOS 8 at the same time. I have created a very simple storyboard that uses a Popover presentation segue to display another view. On the simulator, if I run this for an iPad, it works as expected. However, if I run it for an iPhone, instead of a popover, it displays a full-screen view, on top of the original view. This is fine; however, there is no way to dismiss it and go back to the original

Localize a view within a storyboard using “User Defined Runtime Attributes”

守給你的承諾、 提交于 2019-11-30 01:49:34
问题 I currently have a semi-automated way to localize my views. However, today I found an interesting section in IB, which seems to suggest that I can localize my views from within Interface Builder. So in IB you can define runtime attributes for a selected object in the Identity Inspector. So for my UILabel I can set the text keypath of my label to the String Hello World . However, when I choose the Type = Localized String and then the name of a key in my Localized.strings I don't get a

Uppercase characters in UItextfield

你说的曾经没有我的故事 提交于 2019-11-30 01:11:38
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? Set your textfield type autocapitalizationType to UITextAutocapitalizationTypeAllCharacters on the UITextField self.yourTexField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters; After call delegate // delegate method - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange

Present storyboard ViewController from another ViewController

丶灬走出姿态 提交于 2019-11-30 00:23:13
I have multiple UIViewControllers in my iOS App's Storyboard. I want to open one of the UIViewControllers (in the storyboard) from a different UIViewController. I've tried the code below, but it isn't working even though I used it before iOS 5 and it worked fine. - (IBAction)addNotes:(id)sender { NotesViewController *notesView = [[NotesViewController alloc] initWithNibName:@"NotesViewController" bundle:nil]; [self presentModalViewController:notesView animated:YES]; } How can I perform this action with iOS 5 Storyboards? Assuming you have storyboard, go to storyboard and give your VC an

iOS 7: Misplaced View Frame for “Label - Label” will be different at run time

时光总嘲笑我的痴心妄想 提交于 2019-11-29 20:07:55
I just finished an app on iOS 6 and bought a developer account a week ago so haven't had much time playing with the iOS 7 SDK. Just downloaded the Golden Master version and trying to upgrade my app to be compatible with iOS 7. I received a lot of warnings saying Misplaced View Frame for "Label - Label" will be different at run time. and I am unable to run the program. The project contains tableview and its is parsing and displaying XML feed from an RSS. How to fix this issue? I had the same issue and I get below response form Apple: You need to update the constraints to match the frames of

Color in storyboard not matching UIColor

一曲冷凌霜 提交于 2019-11-29 19:50:14
I am defining a color in code as [UIColor colorWithHue:32.0/360.0 saturation:0.88 brightness:0.97 alpha:1] If I try to set the same color in storyboard, when running the App it is a slightly different colour to the one defined in code. If I drag the color to the palate then select a different color and select the palate one again, the HSB values are slightly different. It seems it is snapping to a different (RGB?) color in interface builder. Xcode 8+, iOS 10+ I recently faced this problem and none of the posted answers did it. It turns out that with the release of iOS 10 SDK, the UIColor

Using stretchable images in Xcode storyboards

不羁的心 提交于 2019-11-29 19:46:50
I'm using storyboards to layout my view controllers and I would like to use stretchable images for my buttons (so that I don't need to generate several images with different sizes). Is this possible to do directly in storyboards without writing any code? I'm really liking the possibility to use storyboards for all graphic stuff and keep the code clean from UI stuff, but it seems like I can't get away with it here. If it is not possible, what would you suggest otherwise? memmons Update for iOS 7+ iOS 7+ now supports stretchable images natively via the asset catalog. Using the asset catalog you