I'm trying to add a badge to the navigation bar of my iOS app,more precisely to the Menu button which triggers my side menu. I'm using this code
// add badge to the menu button
if (!self.numberBadge) {
self.numberBadge = [[MLPAccessoryBadgeEmboss alloc] initWithFrame:CGRectZero];
}
numberBadge.center = CGPointMake(30.0, 6);
numberBadge.badgeMinimumSize = CGSizeMake(1.0, 1.0);
numberBadge.backgroundColor = [UIColor redColor];
numberBadge.shadowAlpha = 0.9;
numberBadge.cornerRadius = 5.0f;
numberBadge.strokeColor = [UIColor whiteColor];
[self.navigationController.navigationBar addSubview:numberBadge];
[numberBadge setTextWithIntegerValue:9];
as result, the badge gets displayed like that:
now I've been trying both modifying the frame and the centre of the badge uiview but, no matter what I do, it will stick to the upper-left corner of the navigation bar. It's currently impossible for me to move it.
Any suggestions?