設置frame屬性值時使用CGRectMake,設置center屬性值時使用CGPointMake.
UILabel *label=[[UILabel alloc]initWithFrame:CGRectZero];
//frame的設置
label.frame=CGRectMake(0, 0, 200, 50);
//center設置
label.center=CGPointMake(160, 240);
//frame的參照
NSLog(@"x=%f",label.frame.origin.x);
NSLog(@"y=%f",label.frame.origin.y);
NSLog(@"width=%f",label.frame.size.width);
NSLog(@"height=%f",label.frame.size.height);
//center的參照
NSLog(@"x=%f",label.center.x);
NSLog(@"y=%f",label.center.y);