storyboard

UIToolbar not positioned at the bottom on device but appears ok in storyboard

冷暖自知 提交于 2020-01-07 07:59:14
问题 I'm testing the new universal storyboard in XCode 6. I basically created a view with a toolbar positioned at the bottom. When I run that basic example in the iPad the toolbar is not at the bottom And here is in the storyboard How can I place the UIToolbar at the bottom and using all the available width for all different screens? 回答1: Use Autolayout. Set the left margin, right margin and bottom space constraints on the toolbar to make it dock at the bottom. Optionally, add a height constraint

iOS Adding Menu Causes Crash When Not First View

邮差的信 提交于 2020-01-07 05:48:07
问题 I am using a storyboard to switch between views. Pretty simple, until I try to add ECSlidingViewController. If I add the above slide menu to the first view I call using this: self.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Main"]; If I set @"Main" to @"Speakers", the view loads just fine. I get the slide menu and everything. @"Main" also loads just fine. However, if I load @"Main" first like in the code above, then switch views to the one I've designated

Pass values between master and detail

别来无恙 提交于 2020-01-07 04:05:21
问题 Which do you think the best way to pass data between the two sides of a split view? Which do you think the best way to call a method from master to detail or from detail to master? Protocols? Segues? Or...? I have seen seem tutorials in this topic but I can not figure out what is the most trivial way of it. 回答1: Protocols are the best way if you need to use them for multiple UIViewControllers . Though if you need to explicitly communicate between two controllers, try simply storing a weak

iOS Auto Layout flexible margins

核能气质少年 提交于 2020-01-07 03:47:29
问题 I'm trying to create a layout that contains flexible vertical margins between specific elements of the static height in Interface Builder . Since I have no idea how I can define that, I tried using "spacer" views with flexible height. The layout I created in Interface Builder is the following: The blue rectangles are the static height ones, and their height should not change . But their margins and spacing between them should change based on screen size. The red rectangles are the spacing

How To shift a view with animation with auto layout constraints are on iOS

折月煮酒 提交于 2020-01-06 19:36:36
问题 I am doing a task in which, i need to shift the view by 35 pixels in order to show a view which is present below that view. Or you can say i need to insert a bar like notification on top and shift the existing view by 35 pixels at runtime. The problem is with auto layout on in order to support all the screens. Shifting is not happening as we want.... Any suggestions here ? Top view has a constraint that its distance with top view is zero, which needs to change at runtime, when we to show the

Xcode Storyboard - Transfer of data

删除回忆录丶 提交于 2020-01-06 09:09:25
问题 I'm new to storyboarding so the answer to this may be simplistic, I've created a viewController in which a UITextField is present. My test is to transfer the data (text) from that text field into a viewController that is pushed onto the screen. The coding that i have is as follows: ViewController1.h - #import <UIKit/UIKit.h> #import "ViewController2.h" @interface ViewController1 : UIViewController @property (nonatomic, retain) IBOutlet UITextField *inputText; @end ViewController1.m #import

Going crazy with UIScrollView and storyboard constraints

∥☆過路亽.° 提交于 2020-01-06 08:56:13
问题 I'm literally going crazy trying to manage a UIScrollView content size programatically. I have a scroll view with another view inside and I need to enlarge this last one and then adapt the scroll view content. Here the extension I'm using for adapt the scroll view content size extension UIScrollView { func updateContentView() { contentSize.height = subviews.sorted(by: { $0.frame.maxY < $1.frame.maxY }).last?.frame.maxY ?? contentSize.height } } I followed a lot of tutorials in order to try to

What is the correct subclass to link storyboard and swiftUI?

浪子不回头ぞ 提交于 2020-01-06 08:07:12
问题 I have created the subclass below to link my swiftui code to my storyboard. The goal is to have a vstack with text containers in it display inside a ContainerView. I am not sure if I am using the right class: NSViewController? I do not get any errors, but the code does not display how I want it to. Mostly, The swiftui does not display inside the window that shows up when I run the app. import SwiftUI class termu: NSViewController { override func viewDidLoad() { super.viewDidLoad() // Do view

Interface Builder: automatically set aspect ratio for UIImageView when using “Aspect Fit”?

六月ゝ 毕业季﹏ 提交于 2020-01-06 07:58:45
问题 The share icon (image is white) below is 114x128 pixels. Fixing the height in Interface Builder to 23 pixels with AutoLayout then using Aspect Fit for the Content Mode does not change the frame rectangle, though. This causes issues with alignment since if you want the icon 15 pixels from the trailing edge, it's now hard to do so. One option is to manually set the aspect ratio (i.e., 114/128) as an AutoLayout constraint within IB. But this is extremely fragile. If you change the image

iOS Tab bar controller containing same Table views inside all tabs but different filtered data

人走茶凉 提交于 2020-01-06 07:53:05
问题 SOLVED: I think I figured it out on how to do it. I added tags to each of my view controllers for each tab. Then in the viewDidLoad method on the view controllers, I can add a switch based on which tab's tag is selected: self.tabBarController.tabBar.selectedItem.tag Issue: I am pretty new to iOS development and need some feedback on this- Here is the scenario: I am using storyboards for this. We have a navigation controller inside a tab bar controller. The Tab bar controller contains the same