如何将 View 的所有内容居中对齐。当我旋转 iPad 时内容未自行居中对齐如何解决此问题?
谢谢!!!
最佳答案
提供 didRotateFromInterfaceOrientation
方法的实现并将所有 subview 居中。
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
for(UIView *subview in [self.view subviews]) {
subview.center = self.view.center;
}
}
关于iphone - UIView - 居中对齐 UIView 的所有内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4496538/