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

- (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");
    }
}

最佳答案

尝试使用self.view代替self

关于ios - UIActionSheet距离屏幕底部太远,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17930290/

10-14 23:13