autoresizingmask

Is it okay to mix autoresizing mask with autolayout?

江枫思渺然 提交于 2020-01-13 20:42:28
问题 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 ? 回答1: As far as I am aware it is

Is it okay to mix autoresizing mask with autolayout?

时光总嘲笑我的痴心妄想 提交于 2020-01-13 20:42:11
问题 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 ? 回答1: As far as I am aware it is

Autoresizing under iOS 10 doesn't work

徘徊边缘 提交于 2020-01-01 06:15:18
问题 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

What is the purpose of UIView's autoresizingMask?

大城市里の小女人 提交于 2019-12-31 09:16:12
问题 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? 回答1: 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

Cannot get UIButton autoresizingMask to work

房东的猫 提交于 2019-12-25 04:03:22
问题 I have the following code: - (void)loadView { [super loadView]; UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 87, self.view.frame.size.width, self.view.frame.size.height)]; scroll.pagingEnabled = YES; NSInteger numberOfViews = 2; scroll.contentSize = CGSizeMake(self.view.frame.size.width * numberOfViews, self.view.frame.size.height); scroll.autoresizingMask=(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); [self.view addSubview:scroll]; for (int

Cannot get UIButton autoresizingMask to work

梦想的初衷 提交于 2019-12-25 04:03:12
问题 I have the following code: - (void)loadView { [super loadView]; UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 87, self.view.frame.size.width, self.view.frame.size.height)]; scroll.pagingEnabled = YES; NSInteger numberOfViews = 2; scroll.contentSize = CGSizeMake(self.view.frame.size.width * numberOfViews, self.view.frame.size.height); scroll.autoresizingMask=(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); [self.view addSubview:scroll]; for (int

UIViewAutoresizingNone: Resize after rotation

╄→尐↘猪︶ㄣ 提交于 2019-12-24 08:47:23
问题 i have a simple structure for IPAD with an AppDelegate that include a view from a viewController : - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ClockVC *clockVC = [[ClockVC alloc]init]; clockVC.view.frame = CGRectMake(100, 100, clockVC.view.bounds.size.width, clockVC.view.bounds.size.height); [self.window addSubview:clockVC.view]; [self.window makeKeyAndVisible]; return YES; } clockVC has a viewDidLoad defined by this code : -

Using autoResizingMask with CGRectZero

元气小坏坏 提交于 2019-12-22 12:57:25
问题 I am building a footer for a tableview's section. The height of the footer will be specified in heightForFooterInSection , so in viewForFooterInSection I would like to just add the subview and specify that the footer view should fill whatever footer height is specified (this footer size will be dynamic). So, I am using CGRectZero as the initial frame and telling the footer view to expand to fill its parent view. - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger

Autoresizing not working in iOS11 / XCode 9

孤街醉人 提交于 2019-12-20 14:06:39
问题 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

NSSplitView and autolayout

纵饮孤独 提交于 2019-12-20 09:49:35
问题 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)]|"