We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using the below code to display a UIBarButtonItem with a Font Awesome icon. The Badge displays behind the shopping cart.
Any help would be appreciated.
let button = MIBadgeButton(type: .Custom) button.badgeString = String(qty) button.frame = CGRectMake(0, 0, 55, 40) button.badgeEdgeInsets = UIEdgeInsetsMake(15, 0, 0, 10) button.titleLabel?.font = UIFont.fontAwesomeOfSize(30) button.setTitle(String.fontAwesomeIconWithName(FontAwesome.ShoppingCart), forState: .Normal) button.setTitleColor(UIColor.whiteColor(), forState: .Normal) button.badgeBackgroundColor = UIColor(red: 147/255, green: 149/255, blue: 151/255, alpha: 1.0) button.setTitleColor(UIColor(red: 147/255, green: 149/255, blue: 151/255, alpha: 0.6), forState: .Highlighted) button.addTarget(self, action: #selector(DryCleaning.backToServices), forControlEvents: UIControlEvents.TouchUpInside) let barButton = UIBarButtonItem(customView: button) self.navigationItem.rightBarButtonItem = barButton
The text was updated successfully, but these errors were encountered:
What is UIFont.fontAwesomeOfSize(30)? I don't get fontAwesome..
Below I change your code and it can display badge without behind anything.
let button = MIBadgeButton(type:.custom) button.badgeString = String("12") button.frame = CGRect(x: 0, y: 0, width: 50, height: 60) button.badgeEdgeInsets = UIEdgeInsetsMake(15, 0, 0, 10) //button.titleLabel?.font = UIFont.fontAwesomeOfSize(30) button.setTitle("asdf", for: .normal) button.setTitleColor(UIColor.red, for: .normal) button.badgeBackgroundColor = UIColor(red: 147/255, green: 149/255, blue: 151/255, alpha: 1.0) button.setTitleColor(UIColor(red: 147/255, green: 149/255, blue: 151/255, alpha: 0.6), for: .highlighted) //button.addTarget(self, action: #selector(DryCleaning.backToServices), forControlEvents: UIControlEvents.TouchUpInside) let barButton = UIBarButtonItem(customView: button) self.navigationItem.rightBarButtonItem = barButton self.title = "nav controller"
Sorry, something went wrong.
No branches or pull requests
Using the below code to display a UIBarButtonItem with a Font Awesome icon. The Badge displays behind the shopping cart.
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: