interface-builder

How to disable select functionality in UITextView?

蓝咒 提交于 2020-01-11 13:01:04
问题 I want to create a text display area (either UILabel or UITextView) in my iPhone app which (1) allows scrolling and (2) does not allow selection. I have tried the following techniques unsuccessfully: Basic UILabel: Didn't allow scrolling, and clipped text to the bottom of UILabel space on screen. Giant UILabel within a UIScrollView: the UILabel kept placing the text (vertically) at the center of the giant UILabel, so it often was outside of my UIScrollView. UITextView: So far this approach

Core Data Relationship Fault

帅比萌擦擦* 提交于 2020-01-10 23:25:00
问题 Tracking a familial relationship in Core Data (1 parent entity + 2 types of children, one of which is recursive), trying to create a drop-menu in Interface Builder that lists the names of the parent entities so that the user can choose one to associate as the parent of the entry being edited. I've got the bindings all set, but when it runs it produces the following error text in the first slot of the menu: Relationship fault for ( <NSRelationshipDescription: 0x100143ed0> ), name parent,

What's the difference between frame and layout in Interface builder's size inspector?

时光总嘲笑我的痴心妄想 提交于 2020-01-10 06:44:05
问题 In IB, there is a dropdown in Size Inspector showing "Layout" and "Frame". I know what a frame is, but I don't know what the layout is in this case. What is the difference? 回答1: When lining controls up and measuring their distances from each other it's often desirable to think about the controls' locations in terms of the visual space they occupy on the screen, rather than simply their raw frames. In many cases, the visual rectangle a control occupies, and its frame are vastly different. For

iOS Auto Layout flexible margins

核能气质少年 提交于 2020-01-07 03:47:29
问题 I'm trying to create a layout that contains flexible vertical margins between specific elements of the static height in Interface Builder . Since I have no idea how I can define that, I tried using "spacer" views with flexible height. The layout I created in Interface Builder is the following: The blue rectangles are the static height ones, and their height should not change . But their margins and spacing between them should change based on screen size. The red rectangles are the spacing

iOS UITableViewCell with custom accessoryView in InterfaceBuilder

北慕城南 提交于 2020-01-07 03:06:22
问题 I'm creating a settings page for my Swift app and (following examples here on SO) I've subclassed a UITableViewCell and in the init() handlers I've set the accessoryView to be a UISwitch() . I also have a custom @IBInspectable property on the subclass which is also marked @IBDesignable : @IBDesignable class TableViewSwitchCell: UITableViewCell { @IBInspectable var settingsKey: String? func build() { accessoryView = UISwitch() } required init?(coder aDecoder: NSCoder) { super.init(coder:

Trouble with Objective-C++ and Interface Builder

ぃ、小莉子 提交于 2020-01-06 15:10:14
问题 My view controller class utilizes an Objective-C++ class. I discovered that I must name it with an .mm extension for C++ imports/includes to work properly. However, I am using Interface Builder, and it does not want to play nicely with my view controller being a .mm file. I get compiler segmented errors. Any suggestions for such a use case? 回答1: First, as Akaru suggested in one of his comments: rename all implementataion files imported to the .mm (entire chain). Another possibilities of

When I double click Mainwindow.xib file the Interface Builder does not open in MonoTouch?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-06 13:52:53
问题 when I double click Mainwindow.xib file the Interface Builder does not open. I did some research but I could not solve it, I encounter with the same question on many websites but there is no solution. I do not know the application type is important or not, I mean I have created iPhone Window-Based, iPhone Navigation-Based but the Interface Builder did not open. Another thing is I use MonoTouch trial version, I do not know if it might be the reason for this. What can I do to solve it? Thanks

Interface Builder: automatically set aspect ratio for UIImageView when using “Aspect Fit”?

六月ゝ 毕业季﹏ 提交于 2020-01-06 07:58:45
问题 The share icon (image is white) below is 114x128 pixels. Fixing the height in Interface Builder to 23 pixels with AutoLayout then using Aspect Fit for the Content Mode does not change the frame rectangle, though. This causes issues with alignment since if you want the icon 15 pixels from the trailing edge, it's now hard to do so. One option is to manually set the aspect ratio (i.e., 114/128) as an AutoLayout constraint within IB. But this is extremely fragile. If you change the image

How to change class dynamically for view controller using interface builder

会有一股神秘感。 提交于 2020-01-06 06:06:58
问题 there are different conditions for same design file. i can't use if-else in same class file to differentiate them. because manage all conditions are difficult. is there any way to change class at dynamic time. 回答1: Yes, we can set class using Xib. But from my research i didn't find any way to change storyboard class dynamically. I found other way to reuse the view like using container view. following link shows how can we reuse storyboard view. Diego Lavalle describe it on medium. and you can

Connect items to a (specific index in) an array from Interface Builder

不羁岁月 提交于 2020-01-06 05:48:07
问题 This one ought to be a softball for the Objective-C pros out there: Is there a way to connect an interface builder object to an element of an NSArray in Objective-C? The connecting would normally be done with IBOutlet , as in: @interface ViewController : UIViewController { IBOutlet UILabel *label1; IBOutlet UILabel *label2; IBOutlet UILabel *label3; //... } Can I put the labels in an NSArray and still attach them to objects in interface builder? 回答1: You should be able to use