ios - 如何将 UIButton 粘贴到 UIScrollView 的底部? (Chatto 框架)

标签 ios swift uiscrollview uibutton chat

我想创建这样一个 UI,它有两个按钮贴在屏幕底部,上面有一个 UIScrollView。我正在使用 Chatto 框架,如果有人能给我一个例子,说明如何基于 https://github.com/badoo/Chatto/tree/master/ChattoApp/ChattoApp 做到这一点,那就太好了。 .

这是我想要的可视化 View 。

What i would like to get

最佳答案

对此有更好的解决方案。您可以通过禁用相应按钮的自动布局(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/

相关文章:

ios - 为 UICollectionView 禁用向右滑动

ios - View Controller 上的设备旋转期间崩溃

ios - 如何防止触摸通过 UIImageView?

ios - 捏缩放 ScrollView 内 UIImageView 的效果?

ios - Obj-C 解析秒到 dd :hh:mm:ss

ios - SwiftUI - 如何模糊 View 的默认背景颜色?

xcode - 检测我是否使用旧版 iOS 不可用的框架的简单方法

ios - 在后台线程上执行的 Realm 写入仍然阻塞主 UI

iOS 在 Storyboard上添加设计时文本

ios - 如何创建两个自定义 Segue,每个方向一个?