interface-builder

Loading NSView subclass from a XIB

一世执手 提交于 2019-12-12 01:46:07
问题 I need to use a custom view into a NSMenuItem. I've created a new view XIB and customized the view in it. How can I load that view and set it in the NSMenuItem using the setView: method? UPDATE : I've found a solution but now the menu item with the custom view doesn't highlight on mouse over. Ho can I solve this problem? 回答1: I've created a NSViewController subclass and set it as the file's owner in the XIB. Then I've set the view outlet of the file's owner to the view in the XIB and finally

IKImageView zooming controlled by an NSSlider

狂风中的少年 提交于 2019-12-12 01:35:15
问题 What's the best practice for setting zoom factor of an image within IKImageView via NSSlider? I was able to bind a slider either to zoom in OR zoom out action of an IKImageView. Obviously, what I'd rather see is a single slider controlling both those actions. Best, if image is refreshed after each change of the slider (continuously, even if a mouse button is not released yet). 回答1: This demo explains a lot: ImageKitDemo In particular, this snippet is what I was looking for: - (IBAction)

How can I update my interface builder project to current constraints?

限于喜欢 提交于 2019-12-12 01:03:51
问题 I have a bunch of constraints set up that work well at run time, but aren't reflected in my storyboard because of small errors in positioning the views. Is there any way I can have my storyboard / xib reset all views to acknowledge the constraints I have set up? If this was already asked, I apologize. I'd expect this has been asked, but my queries aren't returning helpful results. 回答1: There's an option when you click the Resolve AutoLayout Issues tab in Interface Builder called Update Frames

Spacing is inconsistent between devices with constraints in autolayout

北城余情 提交于 2019-12-12 00:46:38
问题 The spacing between the blue button and the right edge of the screen are all different widths between iPhone 6 (first), iPhone 6 Plus (second) and the Interface builders representation. They all line up with different positions on the word Puppies as well as the battery icon... Open full size to see easier 回答1: Turns out it was just the iphone six plus simulator - Yet to try on real 6 plus hardware... Thanks for your help 来源: https://stackoverflow.com/questions/33276148/spacing-is

How to set the transparency color for Toolbar and Navigation bar using MonoTouch?

人盡茶涼 提交于 2019-12-11 23:41:03
问题 How to set the transparency color for Toolbar and Navigation bar? I need to show background image on whole screen. But I can't give the transparency color for Toolbar and Navigation bar. I assigned UIColor.Clear . But no use. It is showing black color. 回答1: Better answer is hide the navigation bar or toolbar.. or its strange requirement so. u hav to use custo navigationbar and custom buttons :) 回答2: For UIToolBar & UINavigationBar Use the below property @property(nonatomic,assign,getter

How To Get Leading Space To Be 1/3 The Width Of the SuperView

半腔热情 提交于 2019-12-11 22:21:13
问题 I am trying to set an icon to be 1/3 along the width of the superview. However when I set the width it's only give me hard values as the option. Is it possible to set the x position of an object to be 1/3rd the width through the interface builder? Thanks Update: Trying to set a .leading against a .width does not appear to be an option for leading: 回答1: You should make the constraint between the icon's centerX and the superview's trailing. In the images below, first, and third refer to the

UISlider height not adjusting correctly

落爺英雄遲暮 提交于 2019-12-11 19:13:27
问题 I'm building a UI for a video player and trying to make sure it looks good on all devices (from iPad Pro down to iPhone SE) Unfortunately I'm having trouble with the dynamic sizing of particular elements. Specifically the UISlider and UILabel. For this question specifically I've hidden the UILabel to focus on the UISlider. Here is my setup in the Interface Builder in Xcode: The relevant portion is the constraint: Seek Bar.height = 0.1 x height This should set the UISlider at the bottom of the

View As different device misplaces centered label within prototype cell in Interface Builder

大城市里の小女人 提交于 2019-12-11 18:26:17
问题 Using Xcode 10.1, I create a tableview on my main storyboard. In the prototype cell, I place a text label. I then create constraints to match it's center with its superview center, both horizontally and vertically. So the label should be centered in the cell. All looks good. When I choose "View as" a different device, it is misaligned horizontally. However when I run in the simulator, it appears to be working OK. Is this an Xcode bug or is there something I'm not understanding about the way

UITableViewCell is wider than its UITableView - extending to the right?

拟墨画扇 提交于 2019-12-11 17:57:00
问题 Background I have a UITableView with a single cell. Inside the cell is a UILabel . The cell, called PickerTableViewCell , gets its UI from a xib and adds it to its subview. This is done because this xib is used by many different custom cells. Problem It appears that when this cell is dequeued by the table view, its width extends beyond the table views width on the right hand side. Here is the xib with the UILabel centred within the cell, followed by how it appears on the device. Notice how

FXLabel crash with UILabel error

爱⌒轻易说出口 提交于 2019-12-11 17:55:11
问题 I am trying to set up FXLabel https://github.com/nicklockwood/FXLabel in my project but i get an error i cant explain. I am using Interface Builder to manage the property. .h File @property (nonatomic) IBOutlet FXLabel *titleLabel; .m File self.titleLabel.shadowColor = [UIColor colorWithWhite:1.0f alpha:0.8f]; self.titleLabel.shadowOffset = CGSizeMake(1.0f, 2.0f); self.titleLabel.shadowBlur = 1.0f; self.titleLabel.innerShadowColor = [UIColor colorWithWhite:0.0f alpha:0.8f]; self.titleLabel