转换后 uibutton 更改高度和 setFrame 不起作用。在这之后。帮我。我的代码在这里:
NSLog(@"BEFORE_Frame_height = %f", nameBgBtn.frame.size.height);
NSLog(@"BEFORE_Bound_height = %f", nameBgBtn.bounds.size.height);
nameBgBtn.transform = CGAffineTransformMakeRotation(degreesToRadian(rndValue));
CGRect newFrame = CGRectMake(nameBgBtn.frame.origin.x,nameBgBtn.frame.origin.y, nameBgBtn.bounds.size.width, nameBgBtn.bounds.size.height);
[nameBgBtn setFrame: newFrame];
[nameBgBtn setBounds:newFrame];
NSLog(@"After_Frame_height = %f", nameBgBtn.frame.size.height);
NSLog(@"After_Bount_height = %f", nameBgBtn.bounds.size.height);
我的记录器:
2013-03-07 15:30:23.887 BEFORE_Frame_height = 46.000000
2013-03-07 15:30:23.888 BEFORE_Bound_height = 46.000000
2013-03-07 15:30:23.888 After_Frame_height = 49.887489
2013-03-07 15:30:23.888 After_Bound_height = 46.000000