//
// ViewController.m
// 02计算器
//
// Created by mac on 15/8/27.
// Copyright (c) 2015年 xujianxing. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIButton *bg;
- (IBAction)up;
- (IBAction)down;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)up {
NSLog(@"上xx");
CGRect frame= self.bg.frame;
frame.size.height=200;
frame.size.width=200;
frame.origin.y=frame.origin.y-10;
self.bg.frame=frame;
NSLog(@"%f",self.bg.frame.size.height);
}
- (IBAction)down {
CGRect frame = self.bg.frame;
frame.origin.y=frame.origin.y+10;
self.bg.frame=frame;
}
@end
只变一种就是好的,同时变好像两个都不行了。。打印没有任何变化。。
这是因为autolayout导致的,去掉就好了。点击view,取消 auto layout。