我正在使用 https://github.com/John-Lluch/SWRevealViewController开发我的应用程序。我在构建应用程序时有两个问题。
我编辑了方法
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
我想通过设置
cell.userInteractionEnabled
来禁用特定 View 上的特定菜单按钮属性,例如当我在 vc1 中时,我禁用了将持续 vc1 的 segue。通过这种方式,我想找出当前 viewcontroller 的 restoreIdentifier 来决定选择,但是我找不到任何方法来让当前 viewController 显示,我试过了self.revealViewController.frontViewController.presentedViewController.restorationIdentifier
self.revealViewController.frontViewController.childViewControllers objectAtIndex:
这是错误的。
2.除了切换 View 的segue功能外,我的应用程序支持手动更改 View ,假设我按下vc1上的某个按钮,应用程序会推送vc2。通过这种方式,SidebarViewController.m 方法,
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
不会再次调用,因此以前的设置不会应用于新的 vc2。我试过
[tableview reload]
,但仍然无法正常工作。感谢大家的大力帮助。
最佳答案
我不知道这是否会对您有所帮助,但如果语言设置发生更改,我将使用此代码本地化我的滑动菜单(我的本地化在应用程序内):
内部 SWRevealViewController.m
.
- (void (^)(void))_rearViewDeploymentForNewFrontViewPosition:(FrontViewPosition)newPosition
...
if ([_rearViewController isKindOfClass:([tvcMenu class])])
{
[((tvcMenu*)_rearViewController).tvMenu reloadData];
}
return completion;
关于ios - 如何在使用 SWRevealViewController 时获取显示并重新加载菜单表的 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21699870/