에 응답하지 내가 이렇게 설정된 UIActionSheet이 있습니다UIActionSheet는 터치
-(void)trash:(id)sender
{
UIActionSheet *sheet = [[[UIActionSheet alloc] initWithTitle:@"Delete" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Remove text" otherButtonTitles:@"Remove tags", nil] autorelease];
[sheet showInView:self.view];
}
시트가 의도 한대로 화면의 하단, 모든 올바른에서 나타납니다. 그러나 버튼 중 아무 것도 활성화되어 있지 않습니다. 유일한 방법은 홈 버튼을 터치하는 것입니다.
누락 된 것이 있습니까?
뷰 self.view는 뷰 컨트롤러의 뷰입니다. 이상한 점은 키보드 위에 있기 때문에 전체 화면 높이보다 작다는 것입니다.
// Never called
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex;
{
NSLog(@"%d",buttonIndex);
}
// Never called
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonInde
{
}
// Never called
- (void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex
{
}
// Called if I hit Home button
- (void)actionSheetCancel:(UIActionSheet *)actionSheet
{
}
// Called second
- (void)didPresentActionSheet:(UIActionSheet *)actionSheet
{
}
// Called first
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet
{
}
:
I는 AppDelegate에이 방법을 [시트 showInView : self.view.window]; 완벽하게 작동합니다. –
나는 이것도 경험했다. 창에 표시하는 것이 잘 작동하므로 그 방법을 사용하고 있습니다. – rpetrich