mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Merge pull request #348 from zhongwuzw/FixMessageInputBarTranslucent
Fix MessageInputBar translucent property
This commit is contained in:
@@ -25,6 +25,9 @@ and the initializer has changed from `public init(image: UIImage? = nil, initals
|
||||
origin Y so that the `cellBottomLabel` is always under the `MessageContainerView`.
|
||||
[#326](https://github.com/MessageKit/MessageKit/pull/326) by [@SD10](https://github.com/sd10).
|
||||
|
||||
- Fixed `MessageInputBar`'s `translucent` functionality.
|
||||
[#348](https://github.com/MessageKit/MessageKit/pull/348) by [@zhongwuzw](https://github.com/zhongwuzw).
|
||||
|
||||
### Removed
|
||||
|
||||
- **Breaking Change** Removed `AvatarAlignment` and `avatarAlignment(for:at:in)` delegate method
|
||||
|
||||
@@ -41,17 +41,10 @@ open class MessageInputBar: UIView {
|
||||
open var backgroundView: UIView = {
|
||||
let view = UIView()
|
||||
view.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.backgroundColor = .white
|
||||
view.backgroundColor = .inputBarGray
|
||||
return view
|
||||
}()
|
||||
|
||||
/// Also sets the backgroundView's backgroundColor to the newValue
|
||||
open override var backgroundColor: UIColor? {
|
||||
didSet {
|
||||
backgroundView.backgroundColor = backgroundColor
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
A UIVisualEffectView that adds a blur effect to make the view appear transparent.
|
||||
|
||||
@@ -73,8 +66,8 @@ open class MessageInputBar: UIView {
|
||||
blurView.fillSuperview()
|
||||
}
|
||||
blurView.isHidden = !isTranslucent
|
||||
let color: UIColor = backgroundView.backgroundColor ?? .white
|
||||
backgroundView.backgroundColor = isTranslucent ? color.withAlphaComponent(0.75) : .white
|
||||
let color: UIColor = backgroundView.backgroundColor ?? .inputBarGray
|
||||
backgroundView.backgroundColor = isTranslucent ? color.withAlphaComponent(0.75) : color.withAlphaComponent(1.0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,7 +284,6 @@ open class MessageInputBar: UIView {
|
||||
/// Sets up the default properties
|
||||
open func setup() {
|
||||
|
||||
backgroundColor = .inputBarGray
|
||||
autoresizingMask = [.flexibleHeight]
|
||||
setupSubviews()
|
||||
setupConstraints()
|
||||
|
||||
Reference in New Issue
Block a user