我正在尝试在我的项目中使用JASidePanels (来自github)。我使用的是centerviewcontroller,leftviewconrtoller和基于库例子的JASidePanelController。我在centerviewcontroller上放置了UIView,然后添加了IBOutlet。
@property (weak, nonatomic) IBOutlet UIView *myview;当菜单出现时,我需要改变它的颜色。我该怎么做呢?我可以改变centerviewcontroller.view的颜色,但是我不能改变我放在centerviewcontroller.view上的UIView的颜色。我可以在centerviewcontroller中更改颜色。
self.myview.backgroundColor = [UIColor redColor];.但我不知道如何在JASidePanelController中做到这一点。
发布于 2014-06-10 08:58:21
假设您的UIViewController名为MyViewController。
以下内容将允许您访问centerViewController以更改其backgroundColor
MyViewController* vc = self.centerViewController;
vc.view.backgroundColor = [UIColor redColor];https://stackoverflow.com/questions/19136371
复制相似问题