2014-05-10 43 views
1

我正在尝试调整侧边栏的大小,但更改仅在我打开边栏后才会反映出来。仅在第二次侧边栏应用的设置打开REFrostedViewController

@implementation MenuViewController 

- (void)viewDidLoad 
{ 
    [self.frostedViewController setLimitMenuViewSize:TRUE]; 
    [self.frostedViewController setMenuViewSize:CGSizeMake(200, [[UIScreen mainScreen] bounds].size.height)]; 
} 

如果有人能帮助我,那会很好。

谢谢!

回答

2

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

- (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); 
} 

在MenuViewController viewDidLoad方法做这种配置使得只有在菜单视图加载的第一要应用的配置时间,所以您的更改仅显示时间。

只需将代码放入REFrostedViewController子类(或者甚至在您正在使用的contentViewController中),您应该没问题。

+0

我想通了,但我的网络出去了。不过谢谢你。 – Zoyt