CGRectInset(CGRect rect,CGFloat dx,CGFloat dy) 以rect為中心按dx,dy縮小(dx,dy正)或放大(dx,dy -)
CGRectOffset(CGRect rect,CGFloat dx,CGFloat dy) 以rect左上角為中心按dx,dy沿方向移動
UIView * view1 = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 80, 80)];
view1.backgroundColor = [UIColor redColor];
[self.view addSubview:view1];
UIView * view2 = [UIView new];
view2.frame = CGRectInset(view1.frame, 20, 20);
view2.backgroundColor = [UIColor blackColor];
[self.view addSubview:view2];