开发者

Show a new view when dismiss an AlertView

开发者 https://www.devze.com 2023-03-27 06:34 出处:网络
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 -

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消