Merge branch 'bugfix/dropshadow_opacity' into 'develop'

Vz up

See merge request BPHV_MIPS/mvm_core_ui!558
This commit is contained in:
Pfeil, Scott Robert 2020-08-07 09:07:16 -04:00
commit 236c42b61c
3 changed files with 10 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import Foundation
public var height: CGFloat?
public var contentMode: UIView.ContentMode?
public var localBundle: Bundle?
public var cornerRadius: CGFloat?
public init(image: String, imageFormat: String? = nil, width: CGFloat? = nil, height: CGFloat? = nil) {
self.image = image
@ -38,5 +39,6 @@ import Foundation
case width
case height
case contentMode
case cornerRadius
}
}

View File

@ -223,6 +223,8 @@ import UIKit
public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
self.delegateObject = delegateObject
super.set(with: model, delegateObject, additionalData)
guard let imageModel = model as? ImageViewModel else { return }
if let accessibilityString = imageModel.accessibilityText {
imageView.accessibilityLabel = accessibilityString
@ -247,6 +249,11 @@ import UIKit
if let contentMode = imageModel.contentMode {
imageView.contentMode = contentMode
}
if let cornerRadius = imageModel.cornerRadius {
clipsToBounds = true
layer.cornerRadius = cornerRadius
}
}
// MARK: - load functions

View File

@ -272,7 +272,7 @@ static const CGFloat VertialShadowOffset = 6;
view.layer.shadowColor = [UIColor blackColor].CGColor;
view.layer.shadowOffset = CGSizeMake(0.0f, VertialShadowOffset);
view.layer.shadowOpacity = 0.7f;
view.layer.shadowOpacity = 0.25f;
view.layer.shadowPath = shadowPath.CGPath;
}