storyboard

Stick UITableView header view to top when creating header in storyboard

假如想象 提交于 2019-12-17 20:37:13
问题 I have created a table view header using the answer here. My problem is that when creating the header this way, it does not "stick" to the top of my UITableView when scrolling down. If I create my header in code inside of viewForHeader then it does stick. How can I get my header to stick to the top while scrolling if I create it in storyboard? 2 other askers here and here asked this question and never got an answer. And yes my UITableView is already plain style, not grouped. 回答1: rdelmar's

Animate Margin / Thickness

自古美人都是妖i 提交于 2019-12-17 20:08:05
问题 I just thought I already know how WPF and XAML Syntax works.... wrooong. I got the message: 'WithEvents' variables can only be typed as classes, interfaces or type parameters with class constraints. Please, do you know why this syntax is wrong? I need to use the single value as double. It works later with an storyboard in codebehind. Regards I just want to animate the Red rectangle with a storyboard in location and size. Perhaps XAML is the right solution anyway? 回答1: To animate thickness,

How to load multiple storyboard files depending on iOS version? (5 and 6)

六月ゝ 毕业季﹏ 提交于 2019-12-17 18:58:43
问题 I have a tab bar controller app that I am trying to make compatible for iOS 6 and iOS 5. For iOS 6, I use auto layout. But when trying to run on iOS 5, I get an error due to it not recognizing NSLayoutConstraints. From what I can tell, I am required to use a different storyboard without auto layout enabled. I have copied my storyboard into a new one, but don't know how to set which storyboard to use in the app delegate. Whats the code to do this? 回答1: In your app delegate, you should find

How to Pass information Back in iOS when reversing a Segue using Swift?

淺唱寂寞╮ 提交于 2019-12-17 18:48:07
问题 I have two view controllers, One and Two. I go from VC One to VC Two. On VC Two, I select some data that I store in an array. When I press the "Back" button on the navigation bar, I would like to send that array back to VC One. What's the best way to do this using Swift & Storyboards? Thanks! 回答1: If you were presenting a modal view with Done and Cancel buttons (sort of like a picker), grabbing the value during an unwind segue method would probably be the easiest. Given that you want to use

Passing data with segue through navigationController

旧巷老猫 提交于 2019-12-17 18:46:42
问题 I'm trying to push data from one viewController to another. I've connected a viewController to another ViewController's navigationController and then set the identifier to "showItemSegue" . I get an error in these two lines: var detailController = segue.destinationViewController as ShowItemViewController detailController.currentId = nextId! Image illustration: The code: override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { nextId =

TableView rounded corners and shadow

别等时光非礼了梦想. 提交于 2019-12-17 18:22:18
问题 I have a tableview with three rows. I am trying to make the table rows have rounded corners and also a shadow effect around the entire tableview. For some reason, I cannot make the tableview both have the rounded corners and shadow effect but I could do them separately if I comment out the code responsible for one of the features. Here is the code I am using: //this is for shadow effect tableView.backgroundColor = UIColor.clearColor() tableView.layer.shadowColor = UIColor.darkGrayColor()

WatchKit: unable to find interface controller class

泄露秘密 提交于 2019-12-17 18:16:12
问题 I tried adding an interface controller to a storyboard, setting its Custom Class to a WKInterfaceController subclass, launched the app in the simulator and navigated to the specified interface controller. When I do so, I get the following error: WatchKit error - unable to find interface controller class 'TestController' to instantiate If I try to interact with the controller (e.g. try launching its button's action), I get the following error: *********** ERROR -[SPRemoteInterface

UILabel Text Not Wrapping

匆匆过客 提交于 2019-12-17 18:13:20
问题 I am working on a Swift project with Storyboards where I want text to wrap in a label. In the old Objective-C version where I did not use a Storyboard I used the following settings and things worked perfectly. Here are the settings for Swift I have been reading about the potential auto layout issues with preferred width settings. I currently have them set to auto layout and the label itself is set to a width of 560. I've added a constraint to keep the label 20 pixels from the trailing

Xcode: “Scene is unreachable due to lack of entry points” but can't find it

让人想犯罪 __ 提交于 2019-12-17 17:36:42
问题 Xcode 4.5.2 gives me the following warning: Unsupported Configuration Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier:. Unfortunately I can't identify the incriminated scene. Selecting the warning in the Issue Navigator doesn't highlight anything in the Storyboard. I have a fairly complicated storyboard (30+ scenes). Any suggestions? 回答1: While this thread is old, I didn't see an answer describing

Storyboard Segue From View Controller to Itself

寵の児 提交于 2019-12-17 17:34:03
问题 I am trying to make a mechanism to drill down a file / folder list. The idea is to show the same file list view controller every time the user selects a folder, and show a file detail view controller if he/she selects a file. So far, I have created a segue from the file list view controller to the file detail view controller, and a segue from the file list table view cell to the the file list table view controller: The issue with this is that as soon as the user taps the cell, the segue is