0

因此,由于某种原因,在我刚刚添加了一个操作表之后,它会出现并停止在屏幕底部上方。有没有办法手动告诉这个在哪里停止?

- (void)showActionSheet:(UIButton *)standardButton{
    UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel Button" destructiveButtonTitle:nil otherButtonTitles:@"Choose From Library", @"Take Photo", nil];
    popupQuery.actionSheetStyle = UIActionSheetStyleAutomatic;
    [popupQuery showInView:self];
}

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (buttonIndex == 0) {
        // Choose from library tapped
        NSLog(@"Choose");
    } else if (buttonIndex == 1) {
        // Take a photo tapped
        NSLog(@"Take");
    } 
}

在此处输入图像描述

4

1 回答 1

1

尝试self.view代替self.

于 2013-07-29T17:25:44.707 回答