简体   繁体   中英

How to change button size xcode?

My code to change button size when press:

  [_btnClick setImage:image forState:UIControlStateNormal];
    //  oldPosition =CGPointMake(sender.bounds.origin.x, sender.bounds.origin.y);
  _btnClick.frame = CGRectMake(oldPosition.x+20  , oldPosition.y+10, 500, 500);

but when i press button, just image change and button size not change to new size.

How i fix it. Thank' for help.

In a related question , an explanation is provided. The only thing that seems valid would be to do what the top answer says. Disable Auto layout

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM