Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round buttons in alert #117

Closed
sergeygarazha opened this issue Oct 1, 2018 · 4 comments
Closed

Round buttons in alert #117

sergeygarazha opened this issue Oct 1, 2018 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@sergeygarazha
Copy link

Describe the bug
Hello! Thank you for great library!
When I'm using alert with rounded corners, bottom corner of buttons not rounded.

To Reproduce
Here is a code:

// attributes
var attributes = EKAttributes.centerFloat
attributes.displayDuration = .infinity
attributes.windowLevel = .alerts
attributes.entryBackground = .visualEffect(style: .dark)
attributes.screenInteraction = .dismiss
attributes.hapticFeedbackType = .warning
attributes.position = .center
attributes.roundCorners = .all(radius: 12)
attributes.border = .value(color: .darkGray, width: 2)
attributes.screenBackground = .color(color: .black.withAlphaComponent(0.45))
attributes.positionConstraints.maxSize = EKAttributes.PositionConstraints.Size(width: EKAttributes.PositionConstraints.Edge.offset(value: 65), height: EKAttributes.PositionConstraints.Edge.intrinsic)
attributes.shadow = .active(with: EKAttributes.Shadow.Value(color: .black, opacity: 0.7, radius: 15, offset: .zero))
// content
let messageImage = EKProperty.ImageContent(imageName: "alert")
let titleLabelStyle = EKProperty.LabelStyle(font: UIFont.bold(20), color: .white, alignment: NSTextAlignment.center, numberOfLines: 0)
let titleLabelContent = EKProperty.LabelContent(text: title, style: titleLabelStyle)
let descriptionLabelStyle = EKProperty.LabelStyle(font: UIFont.systemFont(ofSize: 15), color: .white, alignment: NSTextAlignment.center, numberOfLines: 0)
let descriptionLabelContent = EKProperty.LabelContent(text: message, style: descriptionLabelStyle)
let simpleMessage = EKSimpleMessage(image: messageImage, title: titleLabelContent, description: descriptionLabelContent)
// buttons
let firstButton = configureButton(fontSize: 20, titleColor: .red, title: firstTitle, backgroundColor: .white, highlightedColor: .white, action: firstAction)
let secondButton = configureButton(fontSize: 20, titleColor: .blue, title: secondTitle, backgroundColor: .white, highlightedColor: .white, action: secondAction)
let buttonsBar = EKProperty.ButtonBarContent(with: firstButton, secondButton, separatorColor: .lightGray, expandAnimatedly: true)
// presenting
let alertMessage = EKAlertMessage(simpleMessage: message, imagePosition: .top, buttonBarContent: buttons)
let view = EKAlertMessageView(with: alertMessage)
SwiftEntryKit.display(entry: view, using: attributes)

As I understand, layer mask not applied to buttons layers:
image
image

@huri000
Copy link
Owner

huri000 commented Oct 1, 2018

Hi @sergeygarazha! Thank for opening the issue. Can you elaborate a bit more? Xcode version? SwiftEntryKit version? Devices (iOS, Simulator)?

@sergeygarazha
Copy link
Author

Sure!

  • Xcode 10.0 (10A255)
  • SwiftEntryKit (0.7.2):
  • QuickLayout (= 2.0.2)
    iPhoneX (iOS 12.0), iPhone 8 simulator (iOS 11.4)

@jgoodrick
Copy link
Contributor

I've run into this as well. I didn't notice it at first, because most of my buttons have a clear background. But as soon as I started trying to use a highlight color for the buttons I noticed it.
Xcode 10.0
SwiftEntryKit 0.8.2
iPhone XR Simulator

@huri000 huri000 self-assigned this Jan 5, 2019
@huri000 huri000 added the bug Something isn't working label Jan 5, 2019
@huri000
Copy link
Owner

huri000 commented Jan 5, 2019

A fix is available now - release 0.8.7 🎉

The adjustment was made specifically for EKAlertMessageView and EKRatingMessageView using a unique protocol that is responsible for the layout of the bottom part of those views.
You should be able to set whatever background color you want for the button bar.

@sergeygarazha, @sndrsn, Please let me know if that works for you.

@huri000 huri000 closed this as completed Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants