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

FABButton is rotated weird #1307

Open
kofsiwon opened this issue Sep 28, 2020 · 0 comments
Open

FABButton is rotated weird #1307

kofsiwon opened this issue Sep 28, 2020 · 0 comments

Comments

@kofsiwon
Copy link

Hey. What's wrong?

`
func setupFloatingMenu(){
self.floatingMenu.fabMenuItemSize = CGSize.init(width: 45, height: 45);
self.floatingMenu.shapePreset = .circle;
self.floatingMenu.delegate = self;

    var menuButton = FABButton(image: Icon.add, tintColor: .white);
    menuButton.backgroundColor = #colorLiteral(red: 0.1886929572, green: 0.4163666964, blue: 0.951190412, alpha: 1)
    menuButton.pulseColor = .white;
    self.floatingMenu.fabButton = menuButton;
    
    var reviewItem = FABMenuItem();
    reviewItem.title = "수강후기";
    reviewItem.titleLabel.fontSize = 13;
    reviewItem.titleLabel.textColor = .white;
    reviewItem.titleLabel.backgroundColor = .clear;
    reviewItem.fabButton.shadowColor = .black;
    reviewItem.fabButton.image = #imageLiteral(resourceName: "iconFreeReview");
    reviewItem.fabButton.backgroundColor = .white;
    reviewItem.fabButton.pulseColor = #colorLiteral(red: 0.1886929572, green: 0.4163666964, blue: 0.951190412, alpha: 1);
    
    var buyItem = FABMenuItem();
    buyItem.title = "수강신청";
    buyItem.titleLabel.fontSize = 13;
    buyItem.titleLabel.textColor = .white;
    buyItem.titleLabel.backgroundColor = .clear;
    buyItem.fabButton.shadowColor = .black;
    buyItem.fabButton.image = #imageLiteral(resourceName: "iconFreeBuy");
    buyItem.fabButton.backgroundColor = .white;
    buyItem.fabButton.pulseColor = #colorLiteral(red: 0.1886929572, green: 0.4163666964, blue: 0.951190412, alpha: 1);
    
    self.floatingMenu.fabMenuItems = [reviewItem, buyItem];
}

extension SWFreeLectureTableViewController : FABMenuDelegate{
func fabMenuWillOpen(fabMenu: FABMenu) {
self.blurView.isHidden = false;
self.blurView.alpha = 0;
UIView.animate(withDuration: 0.3, delay: 0) { [weak self] in
self?.blurView.alpha = 0.5;
fabMenu.fabButton?.imageView?.transform = .init(rotationAngle: 45);
} completion: { weak self in
//self?.blurView.isHidden = false;
}

    //    fabMenu.fabButton?.animate(.rotate(45))
    fabMenu.fabButton?.animate(.rotate(25));
}

func fabMenuWillClose(fabMenu: FABMenu) {
    self.blurView.alpha = 0.5;
    UIView.animate(withDuration: 0.3, delay: 0) { [weak self] in
        self?.blurView.alpha = 0;
        fabMenu.fabButton?.imageView?.transform = CGAffineTransform.identity;
    } completion: { [weak self](_) in
        self?.blurView.isHidden = true;
    }
    
    fabMenu.fabButton?.animate(.rotate(0));
}

}`

Screen Shot 2020-09-28 at 4 50 00 PM

Material Version is 3.1.8

Help Me, Please. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant