我想创建这样一个 UI,它有两个按钮贴在屏幕底部,上面有一个 UIScrollView。我正在使用 Chatto 框架,如果有人能给我一个例子,说明如何基于 https://github.com/badoo/Chatto/tree/master/ChattoApp/ChattoApp 做到这一点,那就太好了。 .
这是我想要的可视化 View 。
最佳答案
对此有更好的解决方案。您可以通过禁用相应按钮的自动布局(button.translatesAutoresizingMaskIntoConstraints = false)属性或任何用于 float 按钮的 UIView 来做到这一点:
swift 4 示例
button.translatesAutoresizingMaskIntoConstraints = false
if #available(iOS 11.0, *) {
button.rightAnchor.constraint(equalTo: tableView.safeAreaLayoutGuide.rightAnchor, constant: -10).isActive = true
button.bottomAnchor.constraint(equalTo: tableView.safeAreaLayoutGuide.bottomAnchor, constant: -10).isActive = true
} else {
button.rightAnchor.constraint(equalTo: tableView.layoutMarginsGuide.rightAnchor, constant: 0).isActive = true
button.bottomAnchor.constraint(equalTo: tableView.layoutMarginsGuide.bottomAnchor, constant: -10).isActive = true
}
关于ios - 如何将 UIButton 粘贴到 UIScrollView 的底部? (Chatto 框架),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37031611/