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