
# 会议页面顶部titlebar菜单定制
#### buildTitleBarPopViewItems
**接口描述**
该接口用于构建会议titleBar点击的弹出菜单。
图1会议页面顶部titlebar菜单定制位置   
![](https://support.huaweicloud.com/sdkreference-meeting/figure/zh-cn_image_0269368632.png)
**注意事项**
1. 主持人密码只有主持人可见。其它定制菜单，所有人显示一致。
2. 自定义cell时需要遵循HWMInMeetingCellDelegate（只修改默认顺序不需要遵循代理）
**方法定义**
```
- (NSArray <HWMInMeetingCellModel *> *)buildTitleBarPopViewItems;
// 自定义cll使用以下，遵循HWMInMeetingCellDelegate
/// cell 对象代理
/// @param cellType cellType
- (UITableViewCell *)cellForRowWithCellType:(HWMConfInfoCellType)cellType inTableView:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath;
/// cell点击事件代理
/// @param cellType cellType
- (void)cellSelectedWithCellType:(HWMConfInfoCellType)cellType;
```
**参数描述**
无
**返回值**
无
**示例代码**
```
/// 构建会议titleBar 点击的弹出菜单
- (NSArray <HWMInMeetingCellModel *> *)buildTitleBarPopViewItems{
    HWMInMeetingCellModel *subjectCell = [HWMInMeetingCellModel defaultSubjectCell];
    HWMInMeetingCellModel *encryptCell = [HWMInMeetingCellModel defaultEncryptedCell];
    HWMInMeetingCellModel *confIdCell = [HWMInMeetingCellModel defaultConfIdCell];
    HWMInMeetingCellModel *generalPasswordCell = [HWMInMeetingCellModel defaultGeneralPasswordCell];
    HWMInMeetingCellModel *hostPasswordCell = [HWMInMeetingCellModel defaultHostPasswordCell];
    HWMInMeetingCellModel *lockCell = [HWMInMeetingCellModel defaultConfLockCell];
    HWMInMeetingCellModel *qosCell = [HWMInMeetingCellModel defaultQosCell];
 
    return @[subjectCell,encryptCell, confIdCell, generalPasswordCell, hostPasswordCell, lockCell, qosCell];
}
/// cell 对象代理，高度自适应（需要添加自动行高所需的布局约束），根据需求自定义cell显示，以下为示例代码仅供参考
/// @param cellType cellType
- (UITableViewCell *)cellForRowWithCellType:(HWMConfInfoCellType)cellType inTableView:(nonnull UITableView *)tableView indexPath:(nonnull NSIndexPath *)indexPath{
    NSString *reuseIdentifier = [NSString stringWithFormat:@"CustomCell_%ld", cellType];
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
    }
    cell.contentView.backgroundColor = [UIColor clearColor];
    cell.backgroundColor = [UIColor clearColor];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    UIImageView * safeImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"custom_conf_setting"]];
    [cell.contentView addSubview:safeImg];
    
    UILabel * safeLabel = [[UILabel alloc] init];
    safeLabel.font = [UIFont systemFontOfSize:14];
    safeLabel.textColor = [UIColor whiteColor];
    safeLabel.text = reuseIdentifier;
    [cell.contentView addSubview:safeLabel];
    [safeImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(16);
        make.size.mas_equalTo(CGSizeMake(16, 16));
        make.centerY.mas_equalTo(safeLabel);
    }];
    
    [safeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(safeImg.mas_right).offset(10);
        make.top.mas_equalTo(10);
        make.height.mas_equalTo(34);
        make.bottom.mas_equalTo(-10);
    }]; 
    return cell;
}
 
/// cell点击事件代理
/// @param cellType cellType
- (void)cellSelectedWithCellType:(HWMConfInfoCellType)cellType{
    [UIUtil showMessage:[NSString stringWithFormat:@"点击了菜单：%lu", (unsigned long)cellType]];
}
```
