【发布时间】:2016-11-09 13:09:33
【问题描述】:
我有一个应用程序,我需要在其中水平翻转 UIView(180 度)。此 UIView 还包含 UILabel 和 UIImageView。
我使用这段代码翻转 UIView 并再次翻转 UILabel 和 UIImageView 以避免镜像效果。
-(void)rotateSearchView:(UIView *)searchView{
searchView.layer.transform = CATransform3DMakeRotation(M_PI, 0.0f, 1.0f, 0.0f);
searchView.frame = CGRectIntegral(searchView.frame);
for(UIView *view in searchView.subviews){
view.layer.transform = CATransform3DMakeRotation(M_PI, 0.0f, 1.0f, 0.0f);
view.frame = CGRectIntegral(view.frame);
if([view isKindOfClass:[UITextField class]]){
UITextField *lbl = (UITextField *) view;
[lbl setTextAlignment:NSTextAlignmentRight];
}
}
}
但是现在 UILabel 中的文字和 UIImageView 中的图像是模糊的。
任何建议
【问题讨论】:
-
你为什么要触摸 searchView 子视图?
-
搜索视图是我自定义创建的。
标签: ios objective-c uiview uiimageview catransform3d