diff --git a/CHANGELOG.md b/CHANGELOG.md index 10a3fbde..f01bbbb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Sources/Views/MessageInputBar.swift b/Sources/Views/MessageInputBar.swift index c3c86ef8..c8a3f54e 100644 --- a/Sources/Views/MessageInputBar.swift +++ b/Sources/Views/MessageInputBar.swift @@ -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()