0

I am trying to add a sub view via Code.

MKNumberBadgeView *numberBadge = [[MKNumberBadgeView alloc] initWithFrame:CGRectMake(230, -51, 40, 40)];
    numberBadge.value = 5;

self.navigationController.navigationBar.layer.zPosition = -1;
[self.view addSubview:numberBadge];

Now when i rotate my device how it doesn't move from its location i want it to be orientation (Landscape as well as Portrait) friendly I am an creating application for iphone4/5 which supports both orientation . basically i am trying to add a badge to a button so found this class reference MKNumberBadgeView .

Kindly suggest how to handle subview . Thanks in advance .

vinay chorpa
  • 187
  • 3
  • 16

1 Answers1

0

use MKNumberBadgeView by xib :-

in .xib file take a view then set its class name 'MKNumberBadgeView' add to button in xib.

in .h file @property (retain) IBOutlet MKNumberBadgeView* badgeOne; then set IBOutlet to view.

it is orientation (Landscape as well as Portrait) friendly

Chaman Sharma
  • 641
  • 5
  • 10