Добавление UITableView backgroundView с UIView с UIButton - PullRequest
0 голосов
/ 09 июня 2018

Я пытаюсь установить UITableView backgroundView на UIView, а внутри UIView я добавил UIButton, но UIButton не появляется.Что я делаю не так?

let view: UIView = UIView(frame: CGRect(x: 0, y: 0, width: self.menuTable.bounds.size.width, height: self.menuTable.bounds.size.height))

let loginButton: UIButton = UIButton(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
loginButton.setTitle("Login", for: .normal)
loginButton.backgroundColor = UIColor.white
loginButton.tintColor = UIColor.black
loginButton.addTarget(self, action:#selector(self.pressedConnection), for: .touchUpInside)
view.addSubview(loginButton)

self.menuTable.backgroundView = view
self.menuTable.separatorStyle = .none
...