Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoresize with on interface orientation #17

Closed
karmeye opened this issue May 21, 2015 · 1 comment
Closed

Autoresize with on interface orientation #17

karmeye opened this issue May 21, 2015 · 1 comment

Comments

@karmeye
Copy link

karmeye commented May 21, 2015

If the device is in portrait and the orientation is changed to landscape while the alert is displayed the view is not resized to fit the whole width.

@LindyLo
Copy link

LindyLo commented Jul 28, 2015

Just add

    self.autoresizingMask = UIViewAutoresizingFlexibleWidth;

to - (id)initWithFrame:(CGRect)frame in RKDropdownAlert.m

additionally add constrains to Labels (after [view addSubview]):

titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
    messageLabel.translatesAutoresizingMaskIntoConstraints = NO;

    [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[titleLabel]-|"  options:0 metrics:nil views:NSDictionaryOfVariableBindings(titleLabel)]];
    [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[messageLabel]-|"  options:0 metrics:nil views:NSDictionaryOfVariableBindings(messageLabel)]];


    [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-top_spacing-[titleLabel]-bottom_spacing-[messageLabel]-|"
                                                               options:0
                                                                 metrics:@{@"top_spacing":@30.0,@"bottom_spacing":@10.0}
                                                                   views:NSDictionaryOfVariableBindings(titleLabel,messageLabel)]
     ];

LindyLo pushed a commit to LindyLo/RKDropdownAlert that referenced this issue Jul 28, 2015
@karmeye karmeye closed this as completed Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants