xib

iOS: disable UI mirroring in XIB

若如初见. 提交于 2019-12-03 15:39:22
in iOS 6 there's a new "feature" that mirrors the UI elements in the xib file if the user is on right-to-left locale (hebrew, arabic). ( http://developer.apple.com/library/ios/#documentation/miscellaneous/conceptual/iphoneostechoverview/iPhoneOSTechnologies/iPhoneOSTechnologies.html ) It completely messes up my interface. Is there a way to disable it without disabling auto-layout? Horizontal constraints have the "Direction" option in Interface Builder. By default it's set to "Leading to Trailing" which causes the mirroring. You can set it to "Left to Right" to disable the mirroring. Note,

Load custom UIView with XIB from a View Controller's view using IB

一曲冷凌霜 提交于 2019-12-03 14:39:49
I have a custom UIView ( MyCustomUIView ) which is built using Interface Builder. I'd like to place this custom view in MyViewController 's view, which is also designed using IB. I've placed an UIView as a subview in MyViewController 's XIB and set it's class to MyCustomUIView . The problem is, when I run the code, only a blank view appears. (When I instantiate MyCustomUIView in code, it displays well.) I'm only overriding the initWithFrame: method the following way in MyCustomUIView.m : - (id)initWithFrame:(CGRect)frame { [[NSBundle mainBundle] loadNibNamed:@"MyCustomUIView" owner:self

iOS: Auto Layout vs autoresizingMask - resizing whole view to fill?

纵然是瞬间 提交于 2019-12-03 14:22:30
I've got a storyboard which is built using Auto Layout. Within that storyboard, I'm embedding a UIViewController subclass ( ButtonGridViewController ) in several locations, each of which is a different size. ButtonGridViewController 's view is defined in a xib. What I need is for the entirety of the ButtonGridViewController 's view to simply scale-to-fill the view I'm embedding it in. With the old struts-and-springs method, this was trivial -- just set all the subviews to resize in both directions, and voila, piece of cake. How do I accomplish the same thing using constraints? For what it's

How do I add Main Menu to xib

蓝咒 提交于 2019-12-03 14:19:27
I deleted main menu from my xib file. How can I recreate it without coping it from another freshly created xib? I can't seem find how to tell IB that menu that I add from object library is actually main application menu. You can't. You used to be able to simply connect the mainMenu outlet to your menu, but as of Xcode 4, there is no mainMenu outlet and there is no replacement way to create a Main Menu in an existing nib. You must create a new MainMenu nib using the New File command and either copy the Main Menu object from that nib or just replace the old nib with the new. It doesn't appear

Using a XIB file for custom Tableview Section Header

此生再无相见时 提交于 2019-12-03 13:56:50
I wanted to use a xib file to customise a tableview section in xcode (objective C), and here ar my files: SectionHeaderView.xib is a UIView with a UILabel SectionHeaderView.m #import "SectionHeaderView.h" @implementation SectionHeaderView @synthesize sectionHeader; @end SectionHeaderView.h #import <UIKit/UIKit.h> @interface SectionHeaderView : UIView { IBOutlet UILabel *sectionHeader; } @property (nonatomic, strong) IBOutlet UILabel *sectionHeader; @end and in my MasterViewController.m #import "SectionHeaderView.h" - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:

Good reasons why to not use XIB files?

天大地大妈咪最大 提交于 2019-12-03 11:46:53
问题 Are there any good reasons why I should not use XIB / NIB files with an highly customized UI and extensive animations and super low memory footprint needs? As a beginner I started with XIB. Then I figured out I couldn't do just about everything in them. It started to get really hard to customize things the way I wanted them to be. So at the end, I threw all my XIBs away and did it all programmatically. So when someone asks me if XIB is good, I generally say: Yeah, if you want to make crappy

Segue from Storyboard to XIB

落爺英雄遲暮 提交于 2019-12-03 10:08:48
问题 I have a storyboard View Controller, which is the first screen in my app. The rest of the app is designed with xib's. I want to segue from a button in the storyboard's VC to a XIB file. I know how to do this from a xib to storyboard, but how about this ? Thanks in advance ! 回答1: From xib to storyboard UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil]; UIViewController *initViewController = [storyBoard instantiateInitialViewController]; then [self

Show ViewController from XIB-file-Button - Swift

五迷三道 提交于 2019-12-03 08:23:30
is there a way how to segue from a xib-file (custom TableViewCell) to another ViewController in the Main.storyboard. There's no possibility to drag a segue, like within the main storyboard. In the cell I've got a button, from where I want to change the view. How can I solve it? Thanks! You can always instantiate a view controller from your Storyboard and present it on button tapped: let storyboard = UIStoryboard(name: "Main", bundle: nil) let vc = storyboard.instantiateViewControllerWithIdentifier("ViewControllerID") as UIViewController self.presentViewController(vc, animated: true, completion

How to make UILabel contents non localizible when genetating string via ibtool?

北城余情 提交于 2019-12-03 07:38:22
I have some labels on my xib. Some of them are not need to be localized. When i generate strings file via ibtool all labels content included in result file. How can i exclude some UI objects in IB from localization when generate strings? Unfortunately there is no way to annotate the content of your nib/xib files so that ibtool's --export-strings-file command ignores certain strings. You could instead opt to use the --export-xliff option and then edit the XLIFF file to lock segments that must not be translated (attribute translate="no" ) before sending them out to be localized in all your

Name conventions for xibs

て烟熏妆下的殇ゞ 提交于 2019-12-03 06:34:00
I've been looking at the sample code and sometimes Apple names xib files ClassNameView and sometimes ClassNameViewController . The ClassName is always a UIViewController or UITableViewController , which had me wonder what convention to use when naming a xib. I would think View as it's not really the ViewController , but curious on what the convention is or at least what your naming conventions are for xibs. I use ClassNameView since the xib represents the view, not the view controller. I don't think there is a generally accepted convention. CocoaTouch supports both conventions, with a