interface-builder

How to make a view with picker and toolbar stay at the bottom of iphone screen

别来无恙 提交于 2019-12-11 08:27:08
问题 I am using this code and its placing my view at the top of the viewing area instead of the bottom. Any idea what I am doing wrong? I am not creating the view in swift because I already have it created in IB with a toolbar and pickerview inside it. let height = view.frame.size.height yearView.frame = CGRect(x: 0, y: height - 250, width: self.view.frame.width, height: 250) Even if I use the y coordinate and say 50 the view wont budge from the top. All I am trying to do is place this subview at

Embedding subview in main view Swift

半腔热情 提交于 2019-12-11 07:57:14
问题 If you look at this image (I don't want to upload it, as it does not belong to me), you will see what appears to be a uiview inside the main uiview controller in the settings app of an iPad. My question is, how do I replicate this programatically? In other words, how do I embed a UIView in another? Here's what I know and have done: Based on my research, this is called "subviews". Is this correct? I have created a UIView with the proper elements that I want in interface builder. It is

XCode : How to get resize view buttons in interface builder

戏子无情 提交于 2019-12-11 07:57:00
问题 I opened an old project in Xcode 6 Version 6.0 (6A279r). For certain .xib files IB is showing resize-view buttons as follows: But, for certain .xib files IB is not showing resize-view buttons: How can I enable the missing resize view buttons? 回答1: Alright, this was simple. Just go to "Attributes Inspector" and select "Freeform" under size: 来源: https://stackoverflow.com/questions/25403748/xcode-how-to-get-resize-view-buttons-in-interface-builder

Is it possible to set navigationitem.title from a view's NIB?

﹥>﹥吖頭↗ 提交于 2019-12-11 07:42:41
问题 I am loading a new view from a NIB (initWithNibName) and then I am pushing it into navigation controller stack (pushViewController). In order to have a proper "Back" button each view should have a title. Unfortunately I didn't manage to find a way to set up View Title in the Interface Builder. It can be done in run time: - (void)viewDidLoad { [super viewDidLoad]; self.navigationItem.title = @"MyTitle"; } But I didn't manage to do it in design time in the NIB. Is there a way of doing it? Thank

Using interface builder to Create Loabable Views

元气小坏坏 提交于 2019-12-11 07:42:05
问题 New Method of Getting Items out of Nib Files. Example in answer below. This new Answer is the latest change in this project and Question I want to create a UIView subclass and I want to create an Interface builder file for the UIView. How would I connect the files owner to itself. I want to be able to Design the view and have it create the connections but I dont have a need for a view controller. Other than loading the nib into an array can I use the nib file as a connector to the view itself

In xCode, I'm getting the error “Loaded the nib but the view outlet was not set”?

五迷三道 提交于 2019-12-11 07:09:46
问题 I know there are multiple questions asking the same thing, but none of their solutions worked for me. I made a custom viewController class (Home), and I made a .xib separately. (Effectively, I'll have 2 nibs -- one for the ipad version to load, and another for the iphone). When I try to instantiate an instance of the home class, I got the error I mentioned in the question. In the xib file, all I did was drag a viewcontroller object from the library to the screen, and it automatically added a

Is it true Xcode/IB DOES NOT check for protocols?

一曲冷凌霜 提交于 2019-12-11 06:55:52
问题 Xcode5 milieu only. (Not older versions.) 1) make a new class called say Test. it's a UIViewController @interface Test:UIViewController 2) in storyboard, make a new screen, a UIViewController, change it to "Test" obviously, if you add a control (say, a button) on the storyboard, you can drag it to an IBOutlet defined in Test.h. No problem. 3) Now in Test.h add the two protocols .. @interface Test:UIViewController < UICollectionViewDataSource, UICollectionViewDelegateFlowLayout > 4) now in IB

Is there an option to implicitly localise labels in Interfacebuilder

醉酒当歌 提交于 2019-12-11 06:45:07
问题 Somewhere in a blog post I stumbled upon a strings file which looked like this: // de.lproj/Localizable.strings "This is the title" = "Das ist der Titel" To me this looked like the actual labels in Interface builder were processed by the compiler so that no explicit translations using NSLocalizedString(@"SOME_IDENTIFIER", @""); would be necessary any more. My question now, is whether there is some kind of shortcut or do I need to localise all my individual labels on my view e.g. in the

Change position of attributed title in button

痞子三分冷 提交于 2019-12-11 06:18:43
问题 As you see, I want the title is under the image and the both of them center horizontally. Be careful, they are components of a button. I tried changing inset value on interface builder but it didn't work with others screen (I use auto layout), it messed up. Can I do it by using IB or have to "hard code" 回答1: in interface builder it is easy, just add a button change it to type custom like below image and also title as settings and set the image for your button, i set it as settingsButton.png .

NSPredicateEditor row templates not configurable in interface builder

社会主义新天地 提交于 2019-12-11 06:07:26
问题 I'm creating an assistant sheet in my storyboard in interface builder. The viewController contains an NSPredicateEditor and is connected to a property of the viewController using cocoa bindings. However, I'm not able to properly configure the row templates. When I uncheck one of the predicate operators, I'm not able to re-enable them, nor I'm able to use any of the other provided operators. Doesn't Xcode support NSPredicateEditor anymore, or am I doing anything wrong here? Just to be clear, I