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

cornerRadius of PopMenuDefaultAction doesnt do anything #60

Open
3 tasks done
omarojo opened this issue Nov 25, 2020 · 0 comments
Open
3 tasks done

cornerRadius of PopMenuDefaultAction doesnt do anything #60

omarojo opened this issue Nov 25, 2020 · 0 comments

Comments

@omarojo
Copy link

omarojo commented Nov 25, 2020

✔️ Issue Checklist

✍🏻 Issue Description

Basically Im instantiating a PopMenuDefaultAction and then immediately setting it's cornerRadius, which has no effect to the default one.

@IBAction func btnLibraryTouchUpInside(_ sender: UIButton) {
        if(self.g8.recording == true){ return }
        let libVideoAct = PopMenuDefaultAction(title: "VIDEOS", image: #imageLiteral(resourceName: "btnBtnLoadVideoXxs"), color: nil) { (action) in
            self.showPhotoLibraryBrowser(type: kUTTypeMovie)
        }
        libVideoAct.iconWidthHeight = 40.0
        libVideoAct.cornerRadius = 0.0
        
        let libPhotosAct = PopMenuDefaultAction(title: "PHOTOS", image: #imageLiteral(resourceName: "btnBtnLoadImgXxs"), color: nil) { (action) in
            self.showPhotoLibraryBrowser(type: kUTTypeImage)
        }
        
        libPhotosAct.iconWidthHeight = 40.0
        libPhotosAct.cornerRadius = 0.0
        let actions = [libVideoAct, libPhotosAct]
        // Pass the UIView in init
        let menu = PopMenuViewController(sourceView: sender, actions: actions)
        let sepColor = UIColor(red: 35/255, green: 35/255, blue: 35/255, alpha: 1.0).cgColor
        let bgMenuColor = UIColor(red: 54/255, green: 54/255, blue: 54/255, alpha: 1.0).cgColor
        menu.appearance.popMenuItemSeparator = .fill(Color(cgColor: sepColor), height: 2.0)
        let bgColor = PopMenuColor.configure(background: PopMenuActionBackgroundColor.solid(fill: Color(cgColor: bgMenuColor)), action: PopMenuColor.default().actionColor)
        
        menu.appearance.popMenuColor = bgColor
        menu.appearance.popMenuBackgroundStyle = .none()
        menu.appearance.popMenuCornerRadius = 4.0
        menu.appearance.popMenuActionHeight = 44
        menu.appearance.popMenuFont = UIFont(name: ".sfuitext-bold", size: 8.0)!
        
        
        let newPosition = menu.contentFrame.offsetBy(dx: -15, dy: -45)
        menu.contentFrame = newPosition.inset(by: UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 26.3))
        present(menu, animated: true, completion: nil)
    }

image

💻 Environment

  • iOS Version: 13.5.1
  • Xcode Version: 12.0
  • Device(s): iPhone XS Max
  • Simulator?: I dont know, I dont use it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant