interface-builder

Extend the View Underneath the Status Bar and Multi-tasking Bar on iPhone X Without Manually Adjusting Constraints in Code?

…衆ロ難τιáo~ 提交于 2019-12-12 05:05:05
问题 I was wondering if there's a way to extend a view to be underneath the status bar and multi-tasking bar of the iPhone X without manually adjusting constraints in code based on the device. Using the safe area, container, container margins and top/bottom layout guides doesn't seem to help because the status bar is a different height on the iPhone X vs the previous iPhones and the safe area ends at the top of the multi-tasking bar whereas it ends at the bottom of the screen for previous iPhones.

Setting the text of an NSTextField programmatically

▼魔方 西西 提交于 2019-12-12 05:01:16
问题 I have a GUI built on IB (Xcode 4). It has a Static Text field connected to an NSTextField. After reading the information from an XML file it's supposed to change the text to whatever it is coming from the XML the .h is as follow: IBOutlet NSTextField * DataBaseLocation; the .m NSMutableArray* DBLoc = [[NSMutableArray alloc] initWithCapacity:1]; NSXMLElement* root = [doc rootElement]; NSArray* DBarray = [root nodesForXPath:@"//DataBaseLocation" error:nil]; for(NSXMLElement* xmlElement in

Changing the Title View of a UINavigationController UIViewController in Interface Builder

冷暖自知 提交于 2019-12-12 04:45:35
问题 Is it possible to change the title view (i.e. add a UISegmentedControl ) for a UIViewController contained within a UINavigationController from within Interface Builder? I am currently doing this work from within code with: -(void)viewDidLoad { [super viewDidLoad]; self.navigationItem.titleView = self.filterSegmentedControl; } However, I'd prefer to set everyone up in IB. Thanks! 回答1: Using IB to add a UISegmentedControl to a NavigationBar 来源: https://stackoverflow.com/questions/4881378

App SIGABRTs on AppDelegate

你。 提交于 2019-12-12 03:54:30
问题 I'm trying to debug my app's interface and immediately as it launches it crashes with: libc++abi.dylib: terminating with uncaught exception of type NSException And when I type bt in the debugging pane * thread #1: tid = 0x145ce, 0x00000001917e74bc libsystem_c.dylib`__abort + 176, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x1917e74bc) * frame #0: 0x00000001917e74bc libsystem_c.dylib`__abort + 176 frame #1: 0x00000001917e740c libsystem_c.dylib`abort + 152

Subview disappears with auto layout

笑着哭i 提交于 2019-12-12 03:42:45
问题 I just added a UIView as subview to the main UIView on interface builder (basic single view application). Without setting any constraints, my subview disappears. subview's frame = (0 0; 320 0); Why is that? If I try to add some constraints like for trailing space, leading space, top space and bottom space to be fixed, still my view disappears. How can I solve this? Thank you. Just to clarify thing a little I created a test project (single view application), and added 2 subview to the main

trouble with UIAppearance and UIButton subclassing

送分小仙女□ 提交于 2019-12-12 02:34:51
问题 I have a custom button, that is just a standard UIButton, but with a CAGradientLayer added in. In my custom button, I have defined two properties: @property (nonatomic, strong) UIColor* topColor UI_APPEARANCE_SELECTOR; @property (nonatomic, strong) UIColor* bottomColor UI_APPEARANCE_SELECTOR; If those two values get set, the my button draws itself with a nice linear gradient. Works great. I also like to put as much into InterfaceBuilder as possible. So, on some of these buttons, in IB's

When and why to use initWithNibName:bundle: in development

一笑奈何 提交于 2019-12-12 02:19:31
问题 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; Why we use this method? Is it necessary when using xib file? 回答1: Why we use init with nib ? So we can take a view created with interface builder and initialize a view from that instead of coding everything yourself. it is a good alternative to coding everything if you just need basic things. 来源: https://stackoverflow.com/questions/15633940/when

Grouped UITableView Interface Builder Examples/Tutorial

◇◆丶佛笑我妖孽 提交于 2019-12-12 01:57:54
问题 I'm having an immense amount of trouble figuring out how to populate a Grouped UITableView with custom UITableViewCells. Could anyone point me towards a tutorial on how one might do this? Or does anyone have an example of what a cellForRowAtIndexPath method would look like when creating a Grouped UITableView with custom UITableViewCells? Thanks. 回答1: Here are some guidelines: Each of your group in grouped UITableView is a section. Then the method: - (UITableViewCell *)tableView:(UITableView *

Size Class Issues - Also need a size class key

旧巷老猫 提交于 2019-12-12 01:54:49
问题 In Xcode I am having an issue with the size classes in my app. I am unable to get the right size classes to show that seem to work for all of my different devices. I kind of would like a key to see what the size classes should really be, also the size classes don't seem to really match up. Below is an image attached of an example. I can't get anything correct. I am new to this and I know that I am doing something wrong. Also, I tried this: https://developer.apple.com/library/ios/documentation

UITextView's frame not set in viewWillAppear [duplicate]

耗尽温柔 提交于 2019-12-12 01:48:33
问题 This question already has answers here : Getting subViews' frames in Storyboard (2 answers) Closed 6 years ago . I'm using iOS 6 and Xcode 4.6 and with the Interface Builder I'm adding a UITextView in a scrollbar view . I disabled the scrolling for the Text View and I would like to dynamically resize the Text View so that we can view the full content. I tried with the following code in my controller : - (void)viewWillAppear:(BOOL)animated { CGRect frame = _description.frame; frame.size.height