xib

Xcode 4 and Interface Builder: Editing Vertical Spacing Constraint (Anchor Top, not Bottom)

对着背影说爱祢 提交于 2019-11-30 19:39:07
I've got a widget that is not laying out correctly on device (its looks OK in IB, but its not quite right). The widget is a label and its located about mid-screen. Interface Builder gave it a Vertical Space Constraint with a 'Bottom Anchor'. Here, bottom means bottom of the screen (rather than a widget below, or anchor to top screen). I'm in the inspector, but I don't see how to change to a top anchor (preferably, to the widget above). I tried reading Apple's docs and Editing Constraints in particular, but it was a confusing and did not explain how to make the change (or I missed the

Swift - Assign a NIB to self in class

时光总嘲笑我的痴心妄想 提交于 2019-11-30 17:20:20
问题 I am creating a UIView subclass for a notification dropdown banner. I am using a XIB to build out the view and want to assign that xib to the class when it initializes (i.e. avoiding having to do this from the calling ViewController). Since you can't assign to 'self' in swift, how do I properly do this from within the class itself? class MyDropDown: UIView { func showNotification() { self = UINib(nibName: nibNamed, bundle: bundle).instantiateWithOwner(nil, options: nil)[0] as? UIView } } 回答1:

Integrating a SpriteKit view into a xib view

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 17:08:36
问题 I have a view that I already created using a xib file. Now I would like to add some small elements to this view that would make use some of the physics animations from SpriteKit, so now I need an SKView. Is it possible to add an SKView as a Subview of the view that corresponds to my xib view? I tried this and it does not seem to show anything. The following is in the ViewController corresponding to my XIB view: this.myCustomSKView = new CustomSKView() this.View.AddSubview( this.myCustomSKView

Creating a custom view using a xib

江枫思渺然 提交于 2019-11-30 15:15:11
问题 Using MonoTouch, I'm trying to make a custom view, so I can reuse this view multiple times in a screen. (it's a bunch of labels and buttons) After reading the answer to this post: How to add a custom view to a XIB file defined view in monotouch I must be getting close, but this only seems to allow me to add a custom view, defined in in myCustomView.CS, but what I'm looking for is a way to use a separate .XIB to design my custom view in the interface builder and only use the corresponding cs

Create a XIB only Cocoa Project in xcode 8.3

旧街凉风 提交于 2019-11-30 15:11:18
I'm trying to create a XIB based application in XCode 8.3 but the option to Start a project without a Storyboard has been removed. Here are the steps I am taking to set up my project: Create a new Cocoa Application. Delete Main.Storyboard Delete ViewController.swift Add a new file to the project - a Cocoa Class - subclass of NSWindowController, Also create XIB file checked - named MainWindowController Under General project info- delete reference to Main for Main Interface in app delegate: add var mainWindowController: NSWindowController? in applicationDidFinishLaunching add let

How can i use xib files instead of storyboard in Xcode 5?

ぐ巨炮叔叔 提交于 2019-11-30 14:18:24
I'm very new to ios developing and many of the tutorials i watch follow the xib approach since they were recorded before XCode 5. How can i go with the xib approach in Single View Application? When i delete storyboard and select one of the xib's as the main interface it's not working. Thanks for any tip. Daxesh Nagar add new file in that select the cococatouch and select the Objective -C class and then go to the next click. you show the below screen at the bottom must select the with xib for user Interface.and next AppDelegate.h: @class ViewController; @interface AppDelegate : UIResponder

Creating a custom view using a xib

流过昼夜 提交于 2019-11-30 14:02:46
Using MonoTouch, I'm trying to make a custom view, so I can reuse this view multiple times in a screen. (it's a bunch of labels and buttons) After reading the answer to this post: How to add a custom view to a XIB file defined view in monotouch I must be getting close, but this only seems to allow me to add a custom view, defined in in myCustomView.CS, but what I'm looking for is a way to use a separate .XIB to design my custom view in the interface builder and only use the corresponding cs-file to add logic. If I try to make a XIB with the same name, the contents won't become visible.

Universal app for iPad not loading iPad .xib files?

只愿长相守 提交于 2019-11-30 13:25:47
问题 I have been trying to figure out why this has been happening but it seems that, in the iPad version of my universal app, it is loading the iPhone .xib instead of the iPad one. I have named my iPhone xibs with a suffix of ~iphone.xib and I left my iPad ones just with .xib . I read to do that because someone said that worked for them but in my case it did not work for me! Even if I do ~ipad.xib and ~iphone.xib for the different .xib files, it still loads the iPhone version! * *Is there any way

Resetting Storyboard on Logout

三世轮回 提交于 2019-11-30 11:58:36
问题 I am building an IOS 5.1 web client app that uses a storyboard. One of my actions is "logout", during which I want to reset my root view to the initial view created by the root view of the Storyboard. (When you log in, some view items are removed or added based on who you are; when you log out, I want to reset them to their default values, which I've specified in the storyboard.) I realize that I could programmatically reset/re-add all of the elements, but then what good is the storyboard? I

Universal app for iPad not loading iPad .xib files?

不羁的心 提交于 2019-11-30 07:28:53
I have been trying to figure out why this has been happening but it seems that, in the iPad version of my universal app, it is loading the iPhone .xib instead of the iPad one. I have named my iPhone xibs with a suffix of ~iphone.xib and I left my iPad ones just with .xib . I read to do that because someone said that worked for them but in my case it did not work for me! Even if I do ~ipad.xib and ~iphone.xib for the different .xib files, it still loads the iPhone version! * *Is there any way to completely confirm that it is loading the iPhone version instead of the iPad version? And is there