interface-builder

@IBInspectable not updating Story Board

≡放荡痞女 提交于 2019-12-11 12:23:01
问题 My custom button below works fine on the iOS Simulator - when I set a rotation in Interface Builder it rotates the button when I run the app. However, I can't see the rotation in the Story Board - it just shows the button without applying the transformation. It doesn't matter if I do the transformation inside the drawRect method - same result. import Foundation import UIKit @IBDesignable class CustomButton: UIButton { @IBInspectable var rotation: CGFloat = 0.0 { didSet { self.transform =

Instantiating a Swift ViewController in an Objective-C project

旧时模样 提交于 2019-12-11 12:11:29
问题 I've imported a Swift UIViewController in an Objective-C-based project and I've followed Apple's guide to using Swift Classes in Objective-C and This useful step-by-step Swift integration for Xcode Objc-based projects My project doesn't crash, but I can't get a view to load. I'm attempting to instantiate a viewController , but it shows up as a white blank screen: UIViewController *rootViewController = [storyboard instantiateViewControllerWithIdentifier:@"mySwiftVC"]; I put a breakpoint in

How do I attach an action to a button using Interface Builder?

╄→尐↘猪︶ㄣ 提交于 2019-12-11 12:09:54
问题 I am new to Interface Builder. I have a method (IBAction) defined in my class. I want to fire this method when a particular button is clicked. I cant see any way to add an action via the IBBuilder 回答1: Setting up an Action Right-Click on your control instance Drag to your target and let go . Setting up an Outlet Right-Click on your object instance Drag to your control instance and let go . Inspecting Actions/Outlets/Bindings Right-Click on your object instance 回答2: Have you defined your

View and Unknown Exception

有些话、适合烂在心里 提交于 2019-12-11 11:25:28
问题 I'm having an strange exception when I go to connect the button in interface builder. Any ideas on what is going on. 2011-04-11 14:14:06.251 LittleTipperPro[1419:707] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x19b400> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key numberOne.' *** Call stack at first throw: ( 0 CoreFoundation 0x3697464f __exceptionPreprocess + 114 1 libobjc.A.dylib 0x3101bc5d objc

Problem setting Value for UILabel (iPhone SDK)

别说谁变了你拦得住时间么 提交于 2019-12-11 11:18:11
问题 I'm reasonably new at the iPhone SDK, so please forgive me if this answer's ridiculously obvious. I have a ViewController connected to a .xib file (they are called FirstViewController) I also have a custom class called MyCustomClass. In this class, I have a method like this: - (void)setTheText { [myLabel setText:@"foo"]; } I want to call this method to set the text in a label in FirstViewController.xib So far, I have done this: Dragged in an "Object" into Interface Builder, and set the class

How do I create UIViewController using Xib-file?

青春壹個敷衍的年華 提交于 2019-12-11 11:15:41
问题 Sorry if this question has already been answered but I can't find an answer. I'm creating an app in which I have an UITableViewController and when the accessorybutton in the right side of a cell is selected a new instance of a UIViewController should be created containing the interface found in a .xib-file. The new UIViewController will then be pushed on to the stack and displayed. My question is how do I create the new UIViewController from an existing .xib-file? This is what I have tried so

Force Interface orientation Landscape on a viewController when the rest of the application is in portrait mode

吃可爱长大的小学妹 提交于 2019-12-11 09:00:41
问题 Good evening all! I am developing an application in Portait orientation and i was wander if there is a way for me to change the orientation of only one view to landspace left without messing with the rest of the app. I tried returning - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft); //return UIInterfaceOrientationIsLandscape(interfaceOrientation); } but with no luck... In IB the

ios 7 - transparency in IB not working correctly? setting transparency programmatically also isn't working?

允我心安 提交于 2019-12-11 08:55:37
问题 I have created two UIViewControllers in IB. PROBLEM 1: I can't make the 2. VC transparent. I have read a lot of stackOverFlow solutions but nothing seems to work in my case. I have tried the following setup in IB both in my current project and in this simple project and something strange occurs (IB,for 2.VC): Setting the alpha value below 0,5 Setting opaque to "checked" Setting the background color to "black" https://imageshack.com/i/kqdXWk9Jp The second VC gets pushed when I click "GO TO

Design issues with UITableView cells

穿精又带淫゛_ 提交于 2019-12-11 08:47:47
问题 Have some design issues with my Table View. Below is an image of what my end-result should look like (Sorry, new user so can't display images or more than two hyperlinks). http://casperslynge.dk/2.png And below is what it looks like at the moment: http://casperslynge.dk/iphone1.png I can't make my view in my xib file (attached to a TableViewCell) fill the entire window (width or height). If I set the width to 320 it looks like the picture above. It starts at the beginning of the cell (top

Interface Builder tutorial on how to customize UIButtons in Xcode 4.2

妖精的绣舞 提交于 2019-12-11 08:44:52
问题 I'm trying to build an iPad app that uses custom images as buttons with my own custom behaviors when the buttons are selected, touched up inside, outside, etc. I'm trying to use Interface Builder to do this, but I have a lot of questions as to what the various text fields mean such as Background Image, Shadow Color, Shadow Offset, Highlight Tint, Drawing, etc. Does anyone know of a good tutorial that goes over UIBUttons on Interface Builder? 回答1: Probably the best online custom button