i之后调整照片,此方法被称为:setBound宽度和高度
- (void)correctSize:(UIView*)view{
//check if the newWidth is rounded by 50
CGFloat correctWidth = roundf(_lastScale*_lastWidth/XPCollageGridHorizontalStepSize) * XPCollageGridHorizontalStepSize;
CGFloat correctHeight = roundf(_lastScale*_lastHeight/XPCollageGridVerticalStepSize) * XPCollageGridVerticalStepSize;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5f];
[view setBounds:CGRectMake(view.bounds.origin.x, view.bounds.origin.y, correctWidth, correctHeight)];
//[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, correctWidth, correctHeight)];
[UIView commitAnimations];
}
它舍入相片尺寸; 66的宽度将舍入到50,178到200等 它工作正常,当我使用setFrame方法,但因为即时通讯也使用旋转我想与setBounds一起工作。
当我使用setBounds时,视图将调整大小,但不是调整为像300这样的舍入数字,而是将其大小调整为随机的311.23。
我在这里错过了什么吗?