ios - 如何将标题添加到侧边菜单

标签 ios objective-c swrevealviewcontroller

我刚刚使用 IOS 中的库 SWRevealViewController 创建了一个侧边菜单。当我点击侧边菜单图标时,我想为我的侧边菜单设置标题。

我尝试了下面的代码,但它不起作用。

#import "MenuViewController.h"
#import "SWRevealViewController.h"
@interface MenuViewController ()

@end

@implementation MenuViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"My test title";

这里MenuViewController是TableViewController的子类

例如

for example like the title "Myshopi"

最佳答案

选择-1

TableviewConroller

on your indexpath (0) , set as your title

选择-2

remove the tableviewController and add one UIViewController and embed with tableView and UIlabel

-- UIViewController
  -- UIlabel
  --UITableview

关于ios - 如何将标题添加到侧边菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35744927/

相关文章:

iOS - 禁用答案但保留 Crashlytics

ios - 模态翻转动画后 UINavigationBar 的高度发生变化

ios - 从深层 JSON 结构构建 UITableView

ios - 如何使用按钮管理 SWRevealViewController

ios - swift : Change Tableview Width to 1/2 its size

ios - UIScreenEdgePanGestureRecognizer 触发多次

ios - 是否建议通过 native iOS应用程序中的设置实现更改应用程序语言的操作?

ios - 仅制作一个 ios tabbar app 纵向选项卡

ios - SWRevealViewController panGesture 问题 - IOS/Swift

ios - 在带有框架的 XCode 5 中找不到文件