小编Buh*_*lad的帖子

为什么在可视化调试中看不到inputAccessoryView?

我在这里附加了模拟器屏幕截图和视图调试窗口。 xcode视图调试器模拟器屏幕截图

如您所见,inputAccessoryView在模拟器中可见,但在视觉调试中不可见,并且不明白为什么,请帮助:)

inputAccessoryView的代码:

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        view.backgroundColor = .blue
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    override var inputAccessoryView: UIView? {
        let v = UIView.init(frame: CGRect.init(x: 0, y: 0, width: view.frame.size.width, height: 60))
        v.backgroundColor = .red
        let label = UILabel()
        label.textAlignment = .center
        label.translatesAutoresizingMaskIntoConstraints = false
        v.addSubview(label)
        label.text = …
Run Code Online (Sandbox Code Playgroud)

debugging xcode ios inputaccessoryview

0
推荐指数
1
解决办法
95
查看次数

标签 统计

debugging ×1

inputaccessoryview ×1

ios ×1

xcode ×1