interface-builder

Sizing a control to fit its container in Interface Builder

∥☆過路亽.° 提交于 2020-01-24 12:50:06
问题 Let's say I have a split view, and I want to fill half of it with a table view (a fairly common use case, I would think). Is there any way to tell the table view to size itself to fit the split view or do I really have to size it manually? 回答1: As far as I know, doing it manually is the only way to go. However, if you turn on "snap to cocoa guidelines", the inner view will snap to the edges of the enclosing view as you drag towards them. This makes it easier than having to manually mouse the

cannot modify frame of UIImageView if added through Interface Builder

回眸只為那壹抹淺笑 提交于 2020-01-24 09:35:09
问题 I came across this very peculiar problem where I am unable to modify the frame of a UIImageView. I have isolated it to this very simple example. Starting from a default single view application xcode template, I add a UIImageView in Interface Builder, link it to the ViewController property called testImage, and in ViewController.m I add: -(void)viewDidAppear:(BOOL)animated{ UIImageView* maskImage = [[UIImageView alloc] initWithFrame:self.testImage.frame]; maskImage.image = self.testImage.image

Preview rounded image in iphone

こ雲淡風輕ζ 提交于 2020-01-23 00:36:09
问题 can anyone tell me how can I create an image preview inside a customized cell with the aspect of the ones loaded in the mms'. I've been trying to do it by changing values in IB and I haven't been able to. Thanks a lot! (source: iphonehelp.in) Thanks for the three answers. Doing cell3.imageView.layer.masksToBounds = YES; cell3.imageView.layer.cornerRadius = 16; cell3.imageView.layer.borderColor = [UIColor lightGrayColor].CGColor; cell3.imageView.layer.borderWidth = 1.0; I was able to do part

UIScrollView with scaled UIImageView using autolayout

别来无恙 提交于 2020-01-22 17:48:06
问题 Consider a UIScrollView with a single subview. The subview is an UIImageView with the following size constraints: Its height must be equal to the height of the UIScrollView . Its width must be the width of the image scaled proportionally to the height of the UIImageView . It is expected that the width of the UIImageView will be bigger than the width of the UIScrollView, hence the need for scrolling. The image might be set during viewDidLoad (if cached) or asynchronously. How do you implement

How to use systemGrayXColor in InterfaceBuilder?

拟墨画扇 提交于 2020-01-21 10:22:15
问题 In the Apple documentation under Adaptable Gray Colors I can read that they provide, among other colors: systemGray2Color systemGray3Color systemGray4Color systemGray5Color systemGray6Color In the Interface Builder of Xcode (Version 11.2.1) I can see systemGrayColor but non of the other shades of gray: How do I set those other system gray colors in the Interface Builder? 回答1: Ok, I could use the color by manually changing it in the underlaying XML. I changed the systemColor attribute of the

How to use systemGrayXColor in InterfaceBuilder?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-21 10:21:47
问题 In the Apple documentation under Adaptable Gray Colors I can read that they provide, among other colors: systemGray2Color systemGray3Color systemGray4Color systemGray5Color systemGray6Color In the Interface Builder of Xcode (Version 11.2.1) I can see systemGrayColor but non of the other shades of gray: How do I set those other system gray colors in the Interface Builder? 回答1: Ok, I could use the color by manually changing it in the underlaying XML. I changed the systemColor attribute of the

How to use systemGrayXColor in InterfaceBuilder?

冷暖自知 提交于 2020-01-21 10:21:10
问题 In the Apple documentation under Adaptable Gray Colors I can read that they provide, among other colors: systemGray2Color systemGray3Color systemGray4Color systemGray5Color systemGray6Color In the Interface Builder of Xcode (Version 11.2.1) I can see systemGrayColor but non of the other shades of gray: How do I set those other system gray colors in the Interface Builder? 回答1: Ok, I could use the color by manually changing it in the underlaying XML. I changed the systemColor attribute of the

How to create a NSMatrix of NSImageCell in Interface Builder in 10.6

て烟熏妆下的殇ゞ 提交于 2020-01-21 08:24:06
问题 How can I create a matrix (NSMatrix object) of NSImageCell cells (usually located in an NSImageView) in Interface Builder 3.2.1 (i.e. the one made for Snow Leopard?) In the "old days", you would drag an NSImageView, and then option-drag the corner of the control. It seemed to have stopped working in 3.2.1... Is there another way? Am I doing something wrong? 回答1: Just drag an instance of NSImageView into your view in IB. Select it and then choose Layout > Embed Objects In > Matrix from IB's

How to create a NSMatrix of NSImageCell in Interface Builder in 10.6

こ雲淡風輕ζ 提交于 2020-01-21 08:23:43
问题 How can I create a matrix (NSMatrix object) of NSImageCell cells (usually located in an NSImageView) in Interface Builder 3.2.1 (i.e. the one made for Snow Leopard?) In the "old days", you would drag an NSImageView, and then option-drag the corner of the control. It seemed to have stopped working in 3.2.1... Is there another way? Am I doing something wrong? 回答1: Just drag an instance of NSImageView into your view in IB. Select it and then choose Layout > Embed Objects In > Matrix from IB's

How to create a NSMatrix of NSImageCell in Interface Builder in 10.6

这一生的挚爱 提交于 2020-01-21 08:23:27
问题 How can I create a matrix (NSMatrix object) of NSImageCell cells (usually located in an NSImageView) in Interface Builder 3.2.1 (i.e. the one made for Snow Leopard?) In the "old days", you would drag an NSImageView, and then option-drag the corner of the control. It seemed to have stopped working in 3.2.1... Is there another way? Am I doing something wrong? 回答1: Just drag an instance of NSImageView into your view in IB. Select it and then choose Layout > Embed Objects In > Matrix from IB's