Reputation: 1160
This is the screenshot of my issue.
My problem is the button label is not a view. I can not anchor that notification label to it. If I anchor that label to any of the sides, the screen size will affect it.
Example: 6s Plus
and iPhone SE
It's fine on the bigger phones.
Upvotes: 0
Views: 163
Reputation: 1160
I think the best way is to make a UIView with the badge and the title label in it and just overlay a UIButton with no title. This way you can constraint the badge label and the title label together.
Upvotes: 0
Reputation: 1088
BhargavR has the right idea. Subclass UIButton and add the badge as a subview constrained to the button's textLabel (the UILabel it uses) property.
Upvotes: 1