[IOS] After the button is hidden, the subsequent icons move up to fill

Because the autolayout of ios fixes the position of the control on the screen, after the control is hidden, the control behind it will not top the vacant position.

 

Idea: Redraw the picture.

 

//hide button
    [_signupButton setHidden:YES];

    //move up loginLink label
    CGFloat signupButton_y = _signupButton.frame.origin.y;
    CGFloat loginLink_x = _loginLink.frame.origin.x;
    CGFloat loginLink_width = _loginLink.frame.size.width;
    CGFloat loginLink_heitht = _loginLink.frame.size.height;
    _loginLink.frame = CGRectMake(loginLink_x, signupButton_y, loginLink_width, loginLink_heitht);

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326331129&siteId=291194637
Recommended