JNBTopbar
要求
iOS 11+
安装
JNBTopbar 可通过 CocoaPods 获取。要安装它,只需将以下行添加到您的 Podfile 中:
pod 'JNBTopbar'
示例
下面是如何显示一个持续两秒的问候标签。
JNBTopbar.shared.showWith(contentView: label,
contentBackgroundColor: UIColor.black,
cornerRadius: 6,
screenInsets: UIEdgeInsets(top: 0, left: -8, bottom: -16, right: -8),
shadowColor: UIColor.black.cgColor,
shadowOpacity: 0.7,
shadowRadius: 10,
borderWidth: 2.0,
borderColor: UIColor.white.cgColor,
forDuration: 2.5,
completion: nil)
如果您没有指定 forDuration,则条将在 hide 或另一个 show 调用之前显示。
JNBTopbar.shared.hide { (completed) in
guard completed else { return }
// bar has finished animating uup
}
许可
MIT 许可证。请查看 LICENSE 文件以获取更多信息。