移动UIView的方法

方法1:

- (void) moveAlert: (UIAlertView *) alertView
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    NSLog(@"%@", context);
        [UIView beginAnimations:nil context:context];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
	[UIView setAnimationDuration:0.25f];
	if (![self isLandscape])
		alertView.center = CGPointMake(160.0f, 180.0f);
	else 
		alertView.center = CGPointMake(240.0f, 90.0f);
	[UIView commitAnimations];
	
	[[alertView viewWithTag:TEXT_FIELD_TAG] becomeFirstResponder];
}


方法2:

- (void) moveAlert: (UIAlertView *) alertView
{
    CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0.0, -130.0);
    [alertView setTransform:myTransform];
}


猜你喜欢

转载自blog.csdn.net/wangyangkobe/article/details/19046369
今日推荐