autoresizingmask

cocoa — getting nested NSViews and CALayers to resize proportionally

跟風遠走 提交于 2019-12-07 17:47:45
问题 My NSWindow's contentView is an NSView subclass. It has some other NSView subclasses as subviews. The subviews are layer-based, and those layers in turn contain sublayers. Some of the sublayers have further sub-sublayers. I want the whole thing to resize proportionally when the window is resized. What is the right way to set it up so that will happen? Thanks EDIT: I am not using Interface Builder at all. 回答1: Here's what I've done to get the contents of an NSView to scale proportionally as I

Is it okay to mix autoresizing mask with autolayout?

筅森魡賤 提交于 2019-12-06 13:39:25
I believe using autoresizing for orientational changes would be good while managing the UI with Autolayout. So many programmers are recommending against both at the same time,But As far as I understand it should be fine. Because Autoresizingmask is easy to play with. I think autoresizing mask itself turns into constraints actually I believe translatesAutoresizingMaskIntoConstraints Correct me If I am wrong If its okay or not okay can some explain in depth why ? As far as I am aware it is absolutely alright to use both autolayout and autoresizingmasks together. What you don't want to do is add

Map rotation horribly slow on ios8

有些话、适合烂在心里 提交于 2019-12-05 23:31:47
问题 I got the following code in a VC in an old project (no storyboard, pure code) : - (void)viewDidLoad { [super viewDidLoad]; self.mapView = [[MKMapView alloc] initWithFrame:CGRectInset(self.view.frame, 10, 10) ]; [self.view addSubview:self.mapView]; self.view.backgroundColor = [UIColor redColor]; self.mapView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; self.view

cocoa — getting nested NSViews and CALayers to resize proportionally

只愿长相守 提交于 2019-12-05 23:03:12
My NSWindow's contentView is an NSView subclass. It has some other NSView subclasses as subviews. The subviews are layer-based, and those layers in turn contain sublayers. Some of the sublayers have further sub-sublayers. I want the whole thing to resize proportionally when the window is resized. What is the right way to set it up so that will happen? Thanks EDIT: I am not using Interface Builder at all. Here's what I've done to get the contents of an NSView to scale proportionally as I resize the parent window. First, in interface builder, I added my NSView to the window, then added a

Migrating a project using autoresizing masks for iPhone X

别来无恙 提交于 2019-12-04 12:21:40
We have some legacy projects that are still using Autoresizing masks, and everything was working fine until iOS 11 and iPhone X. With the introduction of safe area layout guides, what's the best solution to support iPhone X? We can convert all interfaces with autoresizing masks to use auto-layouts. This appears to be a significant effort, considering views are being dynamically added and adjusted. We keep using autoresizing masks but adjust the interfaces to add inset margins for iPhone X and iOS 11. A third option would be to use autolayout where you need to and leave the rest of the app with

setAutoresizingMask from code in osx

限于喜欢 提交于 2019-12-03 20:21:48
问题 There is a section in size inspector with name Atosizing that can set left,right,up,down layout of a control,i find that i do that with setAutoresizingMask but don't know how set it that my control layout to right and up (means when user resize window my control steak to right and up) 回答1: Look at these -setAutoresizingMask parameters: NSViewNotSizable The receiver cannot be resized. NSViewMinXMargin The left margin between the receiver and its superview is flexible. NSViewWidthSizable The

UIView and AutoresizingMask ignored

不羁岁月 提交于 2019-12-03 20:07:36
问题 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

Autoresizing under iOS 10 doesn't work

别等时光非礼了梦想. 提交于 2019-12-03 16:22:46
I had a app that works without AutoLayout and Constraints. I only set the autoresizing in the size inspector. Under iOS 9 and earlier works all fine. Under iOS 10 the autoresizing doesn't work and set the size out of the screen. Look at the following picture : Under iOS 10 in the simulator The same is happened on a iPhone 5 and iPhone 6 Plus. What can I do, that the autoresizing works fine. Edit 1: Another workaround is to set the storyboard to Xcode 7.x version. You can do this in the File Inspector under Interface Builder Document . To set the option Opens in to the value Xcode 7.x . Answer

how can i increase the height of an inputAccessoryView

白昼怎懂夜的黑 提交于 2019-12-03 07:24:19
问题 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

Set UIView's autoresizing mask programmatically?

醉酒当歌 提交于 2019-12-03 05:27:54
问题 I have to set autoresizingMask programmatically for UIView . I don't know how to implement this. 回答1: To achieve what you have in that screen shot you need to do the opposite of what DrummerB suggests. You want a fixed top margin so you make every other side flexible like so: Objective C: view.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin; Not setting a side as flexible means that it will be fixed