Ios 设置仅应用于第二次侧栏打开的REFrostedViewController

Ios 设置仅应用于第二次侧栏打开的REFrostedViewController,ios,sidebar,Ios,Sidebar,我正在尝试调整侧边栏的大小,但这些更改仅在我唯一一次打开侧边栏后才会反映出来 @implementation MenuViewController - (void)viewDidLoad { [self.frostedViewController setLimitMenuViewSize:TRUE]; [self.frostedViewController setMenuViewSize:CGSizeMake(200, [[UIScreen mainScreen] bounds

我正在尝试调整侧边栏的大小,但这些更改仅在我唯一一次打开侧边栏后才会反映出来

@implementation MenuViewController

- (void)viewDidLoad
{
    [self.frostedViewController setLimitMenuViewSize:TRUE];
    [self.frostedViewController setMenuViewSize:CGSizeMake(200, [[UIScreen mainScreen] bounds].size.height)];
}
如果有人能帮助我,那就太好了


谢谢大家!

您可以将这些配置放入
REFrostedViewController
子类中。例如(假设您使用的是故事板),您可以在视图控制器分配的正下方配置菜单,例如(但是,请记住,您可以将配置放在REFrostedViewController初始化代码中的任意位置)

在MenuViewController
viewDidLoad
方法中执行此配置将导致仅在第一次加载菜单视图后应用配置,因此您的更改仅在第二次时间显示


只要把代码放在
REFrostedViewController
子类(甚至是你正在使用的contentViewController)中,你就应该没事了。

我知道了,但我的互联网坏了。不过还是谢谢你。
- (void)awakeFromNib
{
    self.contentViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"contentViewController"];
    self.menuViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"menuViewController"];

    self.limitMenuViewSize  = YES;
    self.menuViewSize       = CGSizeMake(200.0, [UIScreen mainScreen].bounds.size.height);
}