Show a new view when dismiss an AlertView
I'm developing for Cydia. There is a way to show 开发者_运维百科a new view when an AlerView did dismiss with a index button?
Implement this delegate and put in what functionality you want -
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
{
if(alertView.tag == 0)
NSLog(@"OK pressed");
else if(alertView.tag == 1)
NSLog(@"Cancel Pressed");
return;
}
Make sure to put valid tag
for the buttons for your AlertView
...
UPDATE: To create a view programmatically, you can do this -
UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 10)];
[yourSuperView addSubview:v];
[v release];
Hope this helps.
精彩评论