autoresizingmask

Autoresizing not working in iOS11 / XCode 9

自闭症网瘾萝莉.ら 提交于 2019-12-03 04:18:20
It appears that the Autoresizing of views is no longer reliably working when building for iOS11 with XCode 9. The layout of several views end up with the positioning of controls as they are in the XIB, but the appropriate resizing has not happened. This has been working fine in iOS10, and works with our old app running in iOS11. However, rebuilding the app the positioning and sizing fails. Has something changed that impacts the use of autoresizingmask ? Is there a way to automatically convert from AutoResizing to AutoLayout and Constraints ? Edit: The controls that are giving trouble are the

Problem setting autosizing in interface builder

久未见 提交于 2019-12-03 01:31:32
I have two viewControllers, one is a subclass of UIViewController (autoresizes correctly), the other one is a subclass of a subclass of UIViewController. I did a layout in Interface Builder, I tested my code in the Simulator and everything works as expected. But if I rotate the device my views don't resize. So I went back to Interface Builder and found out that I cannot change the Resizing property of the "root"-UIView. So I opened another file and the resizing property is fixed there, too. But it is set to resizing in both direction. This is the behavior I want. How can I change the

how can i increase the height of an inputAccessoryView

筅森魡賤 提交于 2019-12-02 20:54:30
I have spent several days on this with no solution in sight. I have an inputAccessoryView which consists of a UIView containing a textView and two buttons. The behaviour of the inputAccessoryView is as expected and works fine in all cases except one. When the height of the textView increases, I am trying to increase the height of the inputAccessoryView by the same amount. When I redefine the height of the inputAccessoryView in textViewDidChange , the inputAccessoryView increases height downwards over the keyboard instead of upwards. I have tried many different suggestions from SO but nothing

NSSplitView and autolayout

末鹿安然 提交于 2019-12-02 20:29:28
How should I use auto layout constrains inside NSSplitView subview? My NSSplitView subview has 3 subview: topPane , tableContainer and bottomPane and I set the constrains like this: NSDictionary* views = NSDictionaryOfVariableBindings(topPane, tableContainer, bottomPane); for (NSView* view in [views allValues]) { [view setTranslatesAutoresizingMaskIntoConstraints:NO]; } [myView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[topPane(34)][tableContainer][bottomPane(24)]|" options:0 metrics:nil views:views]]; [mySplitView addSubview:myView]; And got this in console: Unable

What is the purpose of UIView's autoresizingMask?

瘦欲@ 提交于 2019-12-02 20:21:19
After reading about UIView 's autoresizingMask on SO and developer.apple.com I'm still unclear what the purpose is. What's a situation where setting this property is necessary? Yes, it is often necessary to set it if you don't want to resize the views manually. Note that it is mostly useful for subviews (i.e. those views that don't take the whole screen) rather then the main view of your app. Views typically may need resizing if: the device is rotated an extra view (say, an ad) is added to the view, so the existing subviews have less available space. For example, suppose if you have a view

why might layoutSubviews NOT automatically be called on a view when its frame is set?

依然范特西╮ 提交于 2019-12-01 06:42:15
问题 I have a view. It is part of a large and complex project. When the frame of my view is set, layoutSubviews is not automatically called. Playing around with this, I tried putting the following method into my view: -(void) setFrame: (CGRect) frame { NSLog (@"setting frame"); [super setFrame: frame]; [self setNeedsLayout]; } At this point, layout was redone when the frame was set, as expected. And if I commented out the setNeedsLayout line, layout was not done. Furthermore, when I click on "step

Scale image to fit screen on iPhone rotation

℡╲_俬逩灬. 提交于 2019-11-30 13:49:22
I have a UIScrollView containing an UIImageView and I have some trouble to get the correct behavior when the iPhone rotates. Goal: I am trying to obtain the following when going from portrait to landscape: _________ |AAAAAAA| |BBBBBBB| _________________ |CCCCCCC| | AAAAAA | |DDDDDDD| --> | CCCCCC | |EEEEEEE| | EEEEEE | |FFFFFFF| |_____GGGGGG_____| |GGGGGGG| --------- Here the entire image in the portrait view is scaled to fit in the landscape view when the iPhone rotates. It is also centered. I am also trying to preserve the aspect ratio. User interaction is also on, and the user should be

UIView and AutoresizingMask ignored

核能气质少年 提交于 2019-11-30 13:36:35
First time posting on stack overflow. I've spent hours scouring over many Google searches and have, at this point, practically memorized the UIView and UIViewController class reference docs. No matter what I do, my app is ignoring my efforts to resize my views on orientation change (or any other frame size modifications for that matter.) There are no nibs or xibs involved; I am building all of my views and viewcontrollers programmatically, and they (the viewcontrollers) are all subclasses of one of three custom UIViewController subclasses that I have created. These super classes have the

UIView addsubview after orientation change: Tell view to resize

纵饮孤独 提交于 2019-11-30 04:06:00
问题 I have a UIView as a XIB in Portrait mode. This view is added programmatically to the viewcontroller like this: NSArray *nibObjects = [[NSBundle mainBundle] loadNibNamed:@"InputView" owner:self options:nil]; InputView *inputView = (InputView*)[nibObjects objectAtIndex:0]; [self.view addSubview:inputView]; This view has autoresizing masks set up properly and rotates fine when the orientation changes from Portrait to landscape. However, if the orientation is already landscape and I create the

Scale image to fit screen on iPhone rotation

試著忘記壹切 提交于 2019-11-29 18:56:05
问题 I have a UIScrollView containing an UIImageView and I have some trouble to get the correct behavior when the iPhone rotates. Goal: I am trying to obtain the following when going from portrait to landscape: _________ |AAAAAAA| |BBBBBBB| _________________ |CCCCCCC| | AAAAAA | |DDDDDDD| --> | CCCCCC | |EEEEEEE| | EEEEEE | |FFFFFFF| |_____GGGGGG_____| |GGGGGGG| --------- Here the entire image in the portrait view is scaled to fit in the landscape view when the iPhone rotates. It is also centered.