lundi 2 mars 2015

checkbox in uialertview in ios8

I want to add checkbox exactly as the below image


Expected behaviour


below is my code:



UIButton *nameField = [[UIButton alloc] initWithFrame:CGRectMake(120, 0, 30, 30.0)];
UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 250, 50)];
[v setBackgroundColor:[UIColor clearColor]];
[nameField setImage:[UIImage imageNamed:@"unchecked.png"] forState:UIControlStateNormal];
[v addSubview:nameField];
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Delete selected pods from server?" message:
@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
[av setValue:v forKey:@"accessoryView"];
av.message = @"This will delete all the posts related to the pictures you want to delete!";
[av show];


with the above code I am getting as :


enter image description here


I want to get checkbox beside message..


Any help or suggestion how to proceed?




Aucun commentaire:

Enregistrer un commentaire