[英]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 . 目前我的笔尖只有一个tableview(这个表视图显示自定义单元格)我想在这个笔尖中添加一个在表视图上方左右两侧的两个按钮。 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 . tableview nib是使用实现tableviewdatasource和tableviewdelegateprotocol的viewcontroller文件控制的。 After making these additions to nib . 在对笔尖进行这些添加之后。 what changes do i have to make to the viewcontroller file h and m files. 我必须对viewcontroller文件h和m文件做出哪些更改。
regards silverkid 关于silverkid
Make a resized UIView (ie subView) and UIButtons in main UIView. 在主UIView中制作一个调整大小的UIView(即subView)和UIButtons。 Add table view in subView and required actions on buttons. 在子视图中添加表视图,在按钮上添加所需的操作。
UIToolBar* toolBar =.... //create toolbar with yours buttons
self.tableView.tableHeaderView = toolBar;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.