UIToolbar *boolbar = [UIToolbar new]; boolbar.barStyle = UIBarStyleDefault; [boolbar sizeToFit]; UIBarButtonItem *cancelleftBarButton =[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(buttonClicked:)]; NSArray *array = [NSArray arrayWithObjects:cancelleftBarButton, nil]; [cancelleftBarButton release]; [boolbar setItems:array]; myTextFieldorTextView.inputAccessoryView = boolbar;
thank you many times!
ReplyDeleteThe code fails when you click the button... am i missing something?
ReplyDeleteThe button has on click method "buttonClicked" . So you must implement this method and do resignResponder for the textfield object
ReplyDeleteHope this helps
Thanks
You saved my life!!!! Thank you!!!
ReplyDelete