Implementacja lepkiej stopki / niestandardowego paska narzędzi UITableView

UżywamUITableViewControlleri chciałbym dodać niestandardowy pasek narzędzi w obszarzeUIView.

Próbowałem włączyć pasek narzędzinavigationController (kod poniżej), ale nie będzie działać poprawnie.UITextField nie wywoła delegatów, a naciśnięcia klawiszy pola tekstowego nie będą wyświetlane w samym polu tekstowym.

Korzystanie z paska narzędzi takiego jak ten nie jest moim pierwszym wyborem, chciałbym mieć mój niestandardowy widok pod moim UITableViewController, gdzie mogę umieścić moje elementy, które działają jak UIToolbar. (pozostaje jako stopka UIView)

Kod:

    self.navigationController.toolbarHidden = NO;
    // create toolbar objects
    UITextField *inputField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 230, 31)];
    inputField.backgroundColor = [UIColor clearColor];
    inputField.borderStyle = UITextBorderStyleRoundedRect;
    inputField.inputAccessoryView = self.navigationController.toolbar;
    inputField.returnKeyType = UIReturnKeyDone;
    inputField.delegate = self;


    UIButton *sendButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 50, 30)];
    sendButton.titleLabel.text = @"Send";
    sendButton.backgroundColor = [UIColor greenColor];

    // add objects into navigation controller
    self.toolbarItems = [NSArray arrayWithObjects:
                         [[UIBarButtonItem alloc] initWithCustomView:inputField],
                         [[UIBarButtonItem alloc] initWithCustomView:sendButton], nil];

questionAnswers(1)

yourAnswerToTheQuestion