0

編集可能なフィールド (Textfield、Textarea、Datepicker、Pikerview) 間を移動するためにキーボードで次と前のツールバーをプログラムで作成する方法は?

4

2 に答える 2

0

https://github.com/simonbs/BSKeyboardControls

このコントロールは、このようなテキストフィールドを編集するときにキーボードの上にツールバーを表示できます

ここに画像の説明を入力

于 2013-04-19T15:42:19.343 に答える
0
UIBarButtonItem *prevButton = [[UIBarButtonItem alloc] initWithTitle:@"Prev" style:UIBarButtonItemStyleBordered target:self action:@selector(prevButtonPressed:)];    
UIBarButtonItem *nextButton = [[UIBarButtonItem alloc] initWithTitle:@"Next" style:UIBarButtonItemStyleBordered target:self action:@selector(nextButtonPressed:)];
UIBarButtonItem *flexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(doneButtonPressed:)]

UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
toolbar.barStyle = UIBarStyleBlackTranslucent;
[toolbar setItems:@[prevButton, nextButton, flexibleSpace, doneButton]];

UITextView *textView = [[UITextView alloc] inithWithFrame:CGRectMake(x, y, width, height)];
textView.inputAccessoryView = toolbar;

を使用しUISegmentedControlて、@adali によって投稿されたものと同様の Prev/Next 効果を作成できます

于 2013-04-19T15:49:52.087 に答える