UIActionSheet的Cancel按钮消失

UIActionSheet最后一个按钮看不到,一般是cancelButton,要稍微向上偏移一点才可以。

不过这不是常态,几乎没多少人碰到这个问题,这是在特定情况下才会发生,这个场景就是试用了UITabBar的时候才有。

解决方法:


    UIActionSheet *actionSheet = [[UIActionSheetalloc] initWithTitle:@"title"

                                                             delegate:self

                                                    cancelButtonTitle:@"Cancel"

                                               destructiveButtonTitle:nil

                                                    otherButtonTitles:@"Take Photo", @"Choose From Library", nil];

 

//    [actionSheet showInView:self.view];  // 把这行换成下面的

    [actionSheet showInView:[UIApplicationsharedApplication].keyWindow];

    [actionSheet release];

  

posted on 2012-11-01 12:04  shawn.zp  阅读(576)  评论(0编辑  收藏  举报