UIAlertView without Buttons

by alex 12. March 2011 08:17

//Declare in class following vairiable

UIAlertView *alert;

 

-(void)showAlert{

    alert = [[[UIAlertView alloc] initWithTitle:@"Please Wait..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease];

    

    [alert show];

 

    UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

 

    indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height - 50);

    [indicator startAnimating];

    [alert addSubview:indicator];

    [indicator release];

}

 

-(void)dismissAlert{

    [alert dismissWithClickedButtonIndex:0 animated:YES];

    [alert release];

}


Move alert (UIAlretView)

by alex 29. July 2009 11:44

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Alert" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];

alert.transform = CGAffineTransformTranslate( alert.transform, 0.0, 100.0 );

[alert show];

[alert release];

 

Show alert (UIAlertView) on iPhone

by alex 13. February 2009 16:03

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{

if (buttonIndex == 1) {

//OK clicked

} else {

}

}

 

- (void) _showAlert:(NSString*)title

{

UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:title message:@"Check your networking configuration." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];

[alertView show];

[alertView release];

}

Alert (UIAlertView) with text field (UITextField)

by alex 13. February 2009 14:18

// open a alert with text field,  OK and cancel button

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Send Email" message:@" "

       delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Send", nil];

 

CGRect frame = CGRectMake(14, 45, 255, 23);

if(!emailField) {

emailField = [[UITextField alloc] initWithFrame:frame];

emailField.borderStyle = UITextBorderStyleBezel;

emailField.textColor = [UIColor blackColor];

emailField.textAlignment = UITextAlignmentCenter;

emailField.font = [UIFont systemFontOfSize:14.0];

emailField.placeholder = @"<enter email>";


emailField.backgroundColor = [UIColor whiteColor];

emailField.autocorrectionType = UITextAutocorrectionTypeNo; // no auto correction support

emailField.keyboardType = UIKeyboardTypeEmailAddress; // use the default type input method (entire keyboard)

emailField.returnKeyType = UIReturnKeyDone;

emailField.delegate = self;

emailField.clearButtonMode = UITextFieldViewModeWhileEditing; // has a clear 'x' button to the right

}

 

[alert addSubview:emailField];

 

[alert show];

[alert release];

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen