UIView
別の のサブビューであるを拡大したいと思いUIViewController
ます。
現在、UIView
の右下に配置されていUIViewController
ます。
私の拡大ボタンの機能は、 を拡大し、 のUIView
上UIView
を塗りつぶすこと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
では、明瞭さに影響を与えずにこの拡大機能を実現する他の方法はありますか?
これに関するヘルプをいただければ幸いです。
ありがとう。