【问题标题】:Menuviewcontroller in SwRevealview slide menu not allign in centerSwellview 幻灯片菜单中的菜单视图控制器未居中对齐
【发布时间】:2017-07-16 05:01:06
【问题描述】:

我在 Objective c 中将 SwRevealViewController 用于幻灯片菜单。 在 MenuViewController.m 文件中,我使用了一个 uiview,如下图所示

但在模拟器中它看起来像下面。即它没有出现在中心。 而我对 uilabel 和 uiimagesview 的限制是水平居中对齐。

【问题讨论】:

  • 你需要设置你的侧视图宽度 - revaltogglewidth
  • @Anbu.Karthikrevealtogglewidth 不会给我我的 tableviewcontroller 的中心对齐我猜。请解释

标签: ios objective-c iphone swrevealviewcontroller


【解决方案1】:

覆盖你MenuViewControllerwillLayoutSubviews中的框架,自定义你自己

-(void)viewWillLayoutSubviews{

    [super viewWillLayoutSubviews];

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

}

【讨论】:

  • 你从here获得SWL默认属性
  • @Anubu 谢谢你的回答。我做到了,它对我有用。但问题是当我尝试用手指手势更多地拖动菜单时,它会保持宽度 = _rearViewRevealWidth
  • 当用户拖动视图并增加整数宽度时,我想要一些东西,它总是在中心显示标签和图像
  • @iosdeveloper - 很高兴听到,然后手动设置宽度,平移和点击就可以了,否则我不能在那个场景中工作,所以用户不能说出 excat 答案,检查和自定义一次
  • 感谢您的帮助。将通过自定义来检查
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-11-27
  • 2015-05-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多