How to add a toolbar to the BOTTOM of a UITableView obj-c/ios/xcode

后端 未结 4 1633
误落风尘
误落风尘 2021-02-06 15:07

how do I add Programmaticaly a toolbar with uitextfield at the bottom of a tableview? Like a chat or sms app.. thank you in advance..

4条回答
  •  暖寄归人
    2021-02-06 15:52

    I just found a better trick!

    1. Make sure there is NO Navigation Bar (from your failed attempts)
    2. Drag and drop a "Bar Button Item" (Xcode will magically place it for you at the bottom)
    3. NOTE: If you Run the App now you won't see anything! (so keep reading)
    4. Add the following line of code under viewDidLoad:

    self.navigationController.toolbarHidden = NO;

    Done!

提交回复
热议问题