问题描述
点心栏代码
class func showSnackBar(stringMessage:String,bottomHeight:CGFloat) {
let message = MDCSnackbarMessage()
message.text = stringMessage
MDCSnackbarManager.messageTextColor = .white
MDCSnackbarManager.snackbarMessageViewBackgroundColor = UIColor.orange
MDCSnackbarManager.show(message)
dispatchQueue.main.async {
MDCSnackbarManager.setBottomOffset(bottomHeight)
}
//MDCSnackbarMessageView.setNeedsUpdateConstraints(<#T##UIView#>)
}
这是设备以及模拟器上的内容,用于快餐栏生成的pod文件是 pod'MaterialComponents / Snackbar' pod'MaterialComponents / Snackbar + ColorThemer'
dispatchQueue.main.async {
let alertController = UIAlertController (title: NSLocalizedString("Allow \"Club Apparel\" to access your location?",comment: ""),message: NSLocalizedString("We will use the device location services to help you find stores and serve relevant content.",preferredStyle: .alert)
let settingsAction = UIAlertAction(title: NSLocalizedString("Settings",style: .default) { (_) -> Void in
guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else {
return
}
if UIApplication.shared.canopenURL(settingsUrl) {
UIApplication.shared.open(settingsUrl,completionHandler: { (success) in
print("Settings opened: \(success)") // Prints true
})
}
}
alertController.addAction(settingsAction)
let cancelAction = UIAlertAction(title: NSLocalizedString("Cancel",style: .default,handler: nil)
alertController.addAction(cancelAction)
self.present(alertController,animated: true,completion: nil)
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)