2016-08-23 79 views
-1

我有一个tableView控制器。 我想在YouTube应用中添加一个像按钮一样的浮动按钮。 当我拖动按钮时,它在tableView中,而不是浮动。如何在tableView控制器上添加浮动按钮

+0

欢迎来到StackOverflow。请阅读并遵守帮助文档中的发布准则。 [最小,完整,可验证的示例](http://stackoverflow.com/help/mcve)适用于此处。在您发布代码并准确描述问题之前,我们无法有效帮助您。 – Prune

回答

0

对于这种情况下,你可以使用UITableView里面的UIViewController,而不是UITableViewController。 至于时的UITableViewController你做的东西

[self.view addSubView:customButton]; 
//or 
[self.tableView addSubView:customButton]; 

那么它认为你是为tableViewController主要观点是您的tableView添加一个子视图到您的tableView。

只需要一个UIViewController并在其中添加UITableView作为子视图,并将customButton作为子视图添加到您的主视图中。

[self.view addSubView:myTableView]; 
[self.view addSubView:customButton]; 

或者您可以随时在IB中创建它。 :)

相关问题