Closed Rashesh-Bosamiya closed 7 years ago
Yup,
setUpNotificationBar
add notificationBar.body.numberOfLines = 0
let vertical = NSLayoutConstraint.constraintsWithVisualFormat("V:|[view(>=barHeight)]", options: [], metrics: ["barHeight":BAR_HEIGHT], views: ["view":notificationBar]) constraints += vertical
If you want notification bar to stop expanding at particular point, Just change number of lines something not equal to 0
notificationBar.body.numberOfLines = 5
Ok, Let me check.
Fine, This solution working.
Thank you very much. Appreciate.
Just wondering, Does it support attributedString
?
Yes it does, but need to change some code.
@objc public init(title:String!, message :NSMutableAttributedString!, preferredStyle:GLNotificationStyle, handler: ((Bool) -> Void)?) {
setUpNotificationBar
method as
private func setUpNotificationBar(header:String, body:NSAttributedString, notificationStyle:GLNotificationStyle) {
setUpNotificationBar
method change notificationBar.body.text
as notificationBar.body.attributedText
let notificationBar = GLNotificationBar(title: "", message: 'Pass you NSMutableAttributedString here', preferredStyle: .SimpleBanner, handler: nil)
NOTE: title
must be empty in this case.Thank you very much!!! :1st_place_medal:
The current problem is truncating trailing characters when content is bigger.
label height should grow.
Is there any solution?