UITableView将Web视图和Web视图外部的按钮设置为背景 [英] UITableView set a web view and a button outside the web view as background
问题描述
我是Swift的新手.目前,我正在构建一个具有tableview作为主页的应用程序.我正在尝试从一个网站(webView)和一个按钮作为UITableView的背景视图制作图形,并仅在单元格为空时显示它. 可以吗? 如何结合使用webView和按钮并将其设置为backView使用 tableView.backgroundView =(这里有东西)?
I am new to Swift. Currently I am building an app which has a tableview as the home page. I am trying to make a graph from a website(webView) and a button as the background view of the UITableView and display it only when cell is empty. Is it doable? How can I combine a webView and a button and set it as the backView using tableView.backgroundView = (something here)?
之所以这样做,是因为我需要使用导航控制器来执行segue.我试图将它们放置在另一个视图控制器中,但随后我无法使用推式搜索.
The reason I am doing this is because I need to use the navigation controller for the segue. I have tried to put them in another view controller but then I cannot use push segue.
谢谢.
推荐答案
您可以将TableViewCell用作按钮和Web视图的容器.我添加了mainstoryboard屏幕截图.
You can use TableViewCell as a container of your button and webview. I added the mainstoryboard screenshot.
在表视图中使用自定义单元格在这里自定义单元格
Using custom cell in Table View explained here Custom Cell
希望有帮助.
这篇关于UITableView将Web视图和Web视图外部的按钮设置为背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!