简体   繁体   中英

how to add buttons above tableview in ios

i am implementing this without storyboards. currently my nib only has a tableview ( this table view is showing custom cells ) i want to add in this nib a two buttons on right and left side above the table view . such that these buttons do not get affected by scrolling and are always in view. This i am doing because once this is done then i will add checkboxes against every row and perform action using the buttons. the tableview nib is controlled using a viewcontroller file implementing tableviewdatasource and tableviewdelegateprotocol . After making these additions to nib . what changes do i have to make to the viewcontroller file h and m files.

regards silverkid

Make a resized UIView (ie subView) and UIButtons in main UIView. Add table view in subView and required actions on buttons.

在此输入图像描述

UIToolBar* toolBar =.... //create toolbar with yours buttons
self.tableView.tableHeaderView = toolBar;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM