简体   繁体   English

如何在ios中添加tableview上方的按钮

[英]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.

相关问题 如何在 tableView Swift(iOS) 上方添加 UIView - How to add UIView above a tableView Swift(iOS) iOS-如何在UISplitViewController详细视图上方添加按钮 - iOS- How to add buttons above UISplitViewController Detail View 如何在键盘上方添加按钮 - How to add buttons above keyboard 您是否必须使用UITableView而不是UITableViewController在tableview上方添加按钮? - Do you have to use a UITableView and not a UITableViewController to add buttons above tableview? 如何在TableViewController的tableview上方添加图像-Swift 3 - How to add an image above tableview in TableViewController - Swift 3 如何在 TableViewController 的 TableView 上方添加 TextField - How to add a TextField above the TableView of a TableViewController 如何在iOS中向TableView添加工具栏 - How to add a toolbar to a TableView in iOS 如何在iOS中的tableView上添加imageView - How to add an imageView on a tableView in iOS 如何在TableView的每一行中添加按钮,图像和其他UI元素? (iOS,快速) - How to add buttons, images and other UI elements in each row of TableView? (iOS,Swift) iOS上带有Storyboard的TableView导航栏中的“返回”,“编辑”和“添加”按钮 - Back, Edit and Add buttons in navigation bar of TableView with Storyboard on iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM