xib

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

陌路散爱 提交于 2019-12-04 12:18:21
问题 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? 回答1: 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

Cocoa app without a MainMenu.xib

試著忘記壹切 提交于 2019-12-04 10:23:15
问题 For iOS (Cocoa Touch), it's possible to go to your main.m and replace the fourth argument in UIApplicationMain(int argc, char *argv[], nil, nil) with the class name of your app's delegate, which would then construct the views as needed. However, Cocoa (Mac) projects have the following in main.m: return NSApplicationMain(argc, (const char **)argv); So the question is basically: how do you hand over an app's delegate to Cocoa apps without a MainMenu.xib? 回答1: You can use setDelegate method of

Xib for iPhone and iPad

馋奶兔 提交于 2019-12-04 10:10:14
I have a Xib for iPhone and I need a similar view for iPad, only iPad size. What is the best way of doing this? Can you put both views in the same Xib and somehow specify which one is shown? Or do I need to be make 2 Xib files and 2 classes? I ended up using 1 class. I set the file owner of both XIB files to this same class. I just used the name of the XIB file So I have 2 xibFiles, iPadXib.xib and iPhoneXib.xib NSString *nibFileName = (iPadVersion) ? @"iPadXib" : @"iPhoneXib"; ViewControllerName *vc = [[ViewControllerName alloc] initWithNibName:nibFileName bundle:nil]; Or do I need to be make

Load XIB into ViewController Xamarin?

社会主义新天地 提交于 2019-12-04 09:26:20
It is possible to create and load view from a custom XIB in xamarin? In Objective-C is like: self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; self.window.rootViewController = self.viewController; 1 - Create your XIB file (example MyView). 2 - In the .cs related to the XIB file add this static creator method: partial class MyView : UIView { public MyView (IntPtr handle) : base (handle) { } public static MyView Create() { var arr = NSBundle.MainBundle.LoadNib ("MyView", null, null); var v = arr.GetItem<MyView>(0); return v; } } 3 - Add MyView to the

How To: Self-Sizing Custom-View from XIB with StackView View in iOS

巧了我就是萌 提交于 2019-12-04 08:56:25
问题 I've recently started diving into iOS development with Swift again and am now looking into a custom UIControl. For layout and flexibility this custom view is built using a StackView. What I want to achieve ... ... is basically to simply have the same functionality with the StackView that I usually have when I drag it directly into the storyboard - where it resizes to fit no problem. This essentially the same as self-sizing tableview cells. Showcase I can reduce my CustomView to a simple

XIB File opens like an XML in XCode but opens correctly with Interface Builder

ぃ、小莉子 提交于 2019-12-04 08:49:35
问题 When I double-click my file StartWindow.xib in Xcode 4, it does not open into the integrated Interface Builder; it opens like a XML file. I can open all other xib files and they display as expected. I can open it with the old Interface Builder via "Open with". What can I do to open it with the integrated Interface Builder? 回答1: Go to the File Inspector after selecting the nib file. Under Identity and Type , select the drop down list for File Type and choose the topmost element Default - com

Migrating project to Xcode 7.2 on OS X El Capitan breaks the build

隐身守侯 提交于 2019-12-04 07:43:21
I was running OS X Mavericks before with Xcode 7.1, I just updated to OS X El Capitan and Xcode 7.2. My app was launching fine on the simulator and device without any kind of warnings for storyboard. Now I see a bunch of warnings for missing constraints in storyboard and the app crashes with this error: Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named IBNSLayoutConstraint' I also tried the solution posted on here : Could not instantiate class named IBNSLayoutConstraint I couldn't find placeholder="YES" anywhere in xml

Autoresize not working in xib

倖福魔咒の 提交于 2019-12-04 07:22:57
I made simple design in .xib , deployment target for my app is iOS 5 My view doesn't resizes, when i run my app in simulator or device. here is snapshot of my .xib file.. When i try to run my app in simulator, it runs properly in the simulator of 4", but it does not resizes, when i run my app in the simulator of 3.5". Autoresize subview property is checked. Here is snapshot of my Simulaotrs , first screenshot is for 3.5" and second for 4".. Thanks in advance. if you want to autoresize and autoorder the icons referencing to the upper view, try to play either with the layout tab or create for

Working with One Xib with Multiple Classes

蓝咒 提交于 2019-12-04 06:28:57
问题 I have already asked a question here Handling Multiple Xib or Fixing collapse and expand button on multiple Xib file then I thought to stop using multiple xib and only main xib with different classes but is it possible ?? Can someone guide me in way which is possible for me to do ? Please help me to fix it Code for UIbutton im using - (IBAction)btnPupl:(UIButton *)sender { CGRect rect; sender.selected = !sender.selected; if(sender.selected ){ [sender setImage:[UIImage imageNamed:@"plus_1.png"

How to navigate To a ViewController From xib file of a UIView Class

南楼画角 提交于 2019-12-04 06:19:37
问题 I have a view in my xib file which contain buttons. i want to move to a ViewController when i will press the button (@IBAction) . I have used below code let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil) let nextViewController = storyBoard.instantiateViewControllerWithIdentifier("About") as! AboutViewController self.presentViewController(nextViewController, animated: true, completion: nil) I am getting the error "Value of type 'SlideMenuView' has no member