IOS swift如何在tableView单元格内创建一条小水平线
我有一个tableView UI,我想在TableViewCell内的某个字段下方创建一条小水平线。例如,这是它的外观,我想在位置:佐治亚州亚特兰大的正下方创建一条水平线。这就是主故事板的外观。我只想在原型单元格中的位置字段下方创建一条灰色的细线。任何建议都很好。我已经找到了一种创建线的方法,但它本质上是在TableCell的末尾创建一个边框,这不是我需要的 我的TableView代码如下IOS swift如何在tableView单元格内创建一条小水平线,swift,uitableview,swift3,Swift,Uitableview,Swift3,我有一个tableView UI,我想在TableViewCell内的某个字段下方创建一条小水平线。例如,这是它的外观,我想在位置:佐治亚州亚特兰大的正下方创建一条水平线。这就是主故事板的外观。我只想在原型单元格中的位置字段下方创建一条灰色的细线。任何建议都很好。我已经找到了一种创建线的方法,但它本质上是在TableCell的末尾创建一个边框,这不是我需要的 我的TableView代码如下 func tableView(_ tableView: UITableView, cellForRow
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
{
let mycell = self.StreamsTableView.dequeueReusableCell(withIdentifier: "prototype1", for: indexPath) as! HomePage_TableViewCell
return mycell
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
tableView.backgroundColor = UIColor.clear
return names.count
}
您可以在Xcode界面生成器中通过添加视图(UIView)控件并将高度设置为1来完成此操作
您可以在Xcode界面生成器中通过添加视图(UIView)控件并将高度设置为1来完成此操作