2

サファリ(明らかに4つのiPhone)のリンクをクリックして押したままにすると、「新しいウィンドウで開く」、「開く」などのオプションが表示されます。「コピー」など?

これをどのように呼び出しますか?UIBarButtonItemにこれを実行させることは可能ですか(ただし、押したときだけでなく、クリックするたびに)?

ありがとう

4

1 に答える 1

0

このメニューの表示方法は次のとおりです。

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
                                                         delegate:self 
                                                cancelButtonTitle:@"Cancel", 
                                           destructiveButtonTitle:nil
                                                otherButtonTitles:@"Button 1", @"Button 2", @"Button 3", nil];
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;

[actionSheet showInView:[self view]];
[actionSheet release];

UIBarButtonItemバーボタンアイテムを上記のコードを含むセレクターにポイントするように接続するには。

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndexのメソッドを実装することを忘れないでくださいUIActionSheetDelegate

于 2010-07-13T22:46:21.300 に答える