SwiftEntryKit icon indicating copy to clipboard operation
SwiftEntryKit copied to clipboard

attributes.roundCorners Not working

Open omarojo opened this issue 5 years ago • 7 comments

For some reason my custom view controller doesnt have rounded corners. attributes.roundCorners = .all(radius: 25) is doing nothing.

I saw in your demos in file NibExampleView you set clipsToBounds=true and additionally layer.cornerRadius = 5

I tried doing that in the viewdidload method of my view controller. but still nothing. fyi. my custom view controller is using a nib file.

class G8ClipPreviewVC: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.clipsToBounds = true
        self.view.layer.cornerRadius = 25
        // Do any additional setup after loading the view.
    }
    init() {
        super.init(nibName: type(of: self).className, bundle: nil)
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }


}
  • Device: XSMax
  • iOS Version: 13.2
  • Xcode Version : 11.2.1
  • SwiftEntryKit Release # 1.2.3

omarojo avatar Dec 12 '19 01:12 omarojo

Did you figure this out? I'm running into the same issue.

.border .roundCorners

are both not working for me.

bobbyflowstate avatar Apr 08 '20 01:04 bobbyflowstate

Ran into the same issue.

Confirmed that adding the following seems necessary: clipsToBounds = true layer.cornerRadius = 16

Any note on what's causing attributes.roundCorners not to work?

KyleGoslan avatar Apr 29 '20 21:04 KyleGoslan

I have got the same issue. As @KyleGoslan mentioned, we have to set cornerRadius twice, one with the attributes.roundCorners and with the UIView of the view controller.

akshitzaveri avatar May 08 '20 08:05 akshitzaveri

This is annoying, I'm facing same issue, rounded corners not working. P.S: thanks for a great library :)

benyboariu avatar Jul 15 '20 14:07 benyboariu

you must set view's bgcolor UIColor.clear.

springlo avatar Aug 03 '20 07:08 springlo

This is how I set it up

var attributes = EKAttributes()
attributes.entryBackground = .color(color: EKColor(.white))
attributes.roundCorners = .top(radius: 40)

The pop-up view needs to be clear color

feixue299 avatar Aug 09 '21 09:08 feixue299

i set view background color to clear, it still not working

minhvblc avatar Jun 22 '23 02:06 minhvblc