0

I am using SwRevealViewController for slidemenu in Objective c. In MenuViewController.m file i am using one uiview which look like below storyboad enter image description here

But in simulater it looks like below. i.e it doest not appear in center. Whereas my contraints for uilabel and uiimagesview in horizontally center allign. enter image description here

Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
ios developer
  • 3,363
  • 3
  • 51
  • 111

1 Answers1

1

over ride the frame in willLayoutSubviews of your MenuViewController,customize ur self

-(void)viewWillLayoutSubviews{

    [super viewWillLayoutSubviews];

      [self.view setFrame:CGRectMake(0, 0, self.view.frame.size.width - self.revealViewController.rearViewRevealWidth , self.view.frame.size.height)];

}
Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
  • you get the SWL default property from [here](http://stackoverflow.com/questions/25175982/how-to-show-resized-sidebar-using-swrevealviewcontroller/25176222#25176222) – Anbu.Karthik Feb 25 '17 at 09:43
  • @Anubu Thank you for the answer. I did it and it works for me.But the problem is when i try to drag menu more with the finger gesture it stays with the width = _rearViewRevealWidth – ios developer Feb 25 '17 at 09:59
  • i want something when user drag the view and it increase ints width it always show the label and image in the center – ios developer Feb 25 '17 at 10:00
  • @iosdeveloper - happy to hear, then do onething manually set the width, it willl be fine for pan and click, else i m not worked that scenario so u i cant say the excat answer, check and customize once – Anbu.Karthik Feb 25 '17 at 10:01
  • Thank you for the help. will check by customizing it – ios developer Feb 25 '17 at 10:05