2

我想放大UIView这是另一个的子视图UIViewController

目前UIView放置在 的右下角UIViewController

我的放大按钮所做的是,它将放大UIViewUIView填充在UIViewController. 我曾经transform这样做过。

这是我的代码,

UIViewController.m (1024*748 大小)

@property (nonatomic, strong) MyUIViewController *myUIViewController;  //subclass of UIView

//adding as subview and assigning its "rootView" as self.
self.myUIViewController = [[MyUIViewController alloc] initWithFrame:CGRectMake(371, 420, 648, 299)];
self.myUIViewController.rootView = self;
[self.view addSubview:self.myUIViewController];

MyUIViewController

 @property (nonatomic, weak) UIViewController *rootView;  

- (void)enlargeView:(UITapGestureRecognizer *)sender
{
    @try
    {
            [UIView beginAnimations:nil context:nil];
            [UIView setAnimationDelegate: self];
            [UIView setAnimationDuration:2];
            [UIView setAnimationDelay:0];

            CGAffineTransform scaleTransform = CGAffineTransformScale( self.transform, 1.55, 2.4  );
            self.transform = scaleTransform;
            [UIView commitAnimations];

            [self setCenter:self.rootView.view.center];
        }

    }
    @catch (NSException *exception)
    {
        NSLog(@"%s\n exception: Name- %@ Reason->%@", __PRETTY_FUNCTION__,[exception name],[exception reason]);
    }
}

目前它可以很好地放大动画。但是有一个清晰度问题。

那么有没有其他方法可以在不影响MyUIViewController清晰度的情况下实现这个放大功能?

对此的任何帮助表示赞赏。

谢谢。

4

0 回答 0