【问题标题】:How can I make my UINavigationBar not look all scrunched up?我怎样才能让我的 UINavigationBar 看起来不那么皱巴巴的?
【发布时间】:2013-08-19 18:14:33
【问题描述】:

按照these instructions 制作一个带有两个子控制器的视图控制器,这些子控制器的平移类似于侧边栏布局,使我的导航栏在侧边栏打开时看起来都皱巴巴的。

我有办法解决这个自动布局问题吗?

编辑-

- (void)viewDidLoad
{
    [super viewDidLoad];
  self.leftCon.constant = -280;
    // Do any additional setup after loading the view.
  //[self slideToTheRight];
}

-(void)slideToTheRight{
  self.sidebarOpened = YES;

  [UIView animateWithDuration:0.5 animations:^{
    self.leftCon.constant = 0;



  }];
}

-(void) slideBack{
  self.sidebarOpened = NO;

  [UIView animateWithDuration:0.5 animations:^{
    self.leftCon.constant = -280;
  }];
}

当左侧约束从 -280 更改为 0 时,基本上右侧栏按钮项和 titleView 最终会压在屏幕右侧。

【问题讨论】:

  • 没有看到你当前的布局,这将是困难的......
  • 我只是按照这里的说明进行操作:stackoverflow.com/a/18282806/75350
  • 对那些被“碾压”的项目有什么限制?
  • 不...我的意思是,只要导航栏稍微可见,导航栏上的所有内容都会集中在屏幕右侧。
  • 你是在 iOS 7 中设计的吗?

标签: iphone ios sdk autolayout


【解决方案1】:

我只需要删除右子视图尾随宽度的约束。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-03
    • 2012-11-28
    • 2016-02-29
    相关资源
    最近更新 更多