Я хочу добавить кнопки в ячейку табличного представления:
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "mycell")
cell?.backgroundColor = UIColor.clear
let view2: UIView = UIView()
view2.frame = CGRect(x: 0, y: 0, width: view.bounds.width, height: 100)
view2.backgroundColor = UIColor.white
cell?.contentView.addSubview(view2)
prifilebtn = UIButton()
prifilebtn.frame = CGRect(x: 20, y: (view.bounds.height-60)/2, width: 60, height: 60)
prifilebtn.layer.cornerRadius = 30
prifilebtn.clipsToBounds = true
prifilebtn.backgroundColor = UIColor.red
view2.addSubview(prifilebtn)
return cell!
}
prifilebtn
не отображается должным образом при просмотре, который я добавил в ячейку.Я пытаюсь сделать это программно.Я не знаю, что является причиной проблемы - любая помощь приветствуется.Заранее спасибо