に応答していません: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];
}
シートが意図したように、画面の下から現れ、すべて正しいです。ただし、いずれのボタンもアクティブではありません。唯一の方法は、[ホーム]ボタンをタッチすることです。
紛失しているものがありますか?
view self.viewはView Controllerのビューです。奇妙な点は、キーボードの上にあるため、画面全体の高さよりも小さいことです。
// 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