移动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];
}


你可能感兴趣的:(ios)