IM 即时通讯 (442)
Android (209)
- 初始化&链接 (8)
- 事件&监听处理 (7)
- 用户信息 (13)
- 会话列表 (16)
- 聊天会话 (26)
- 消息处理 (35)
- 自定义消息 (6)
- 音视频 (2)
- 推送&通知 (34)
- 扩展功能 (4)
- 第三方地图 (3)
- 依赖&配置 (9)
- 升级说明 (3)
- 其他 (43)
iOS (168)
- SDK 导入 (10)
- 连接 (8)
- 事件处理 (2)
- 用户信息 (3)
- 会话列表 (14)
- 聊天会话 (44)
- 消息处理 (26)
- 自定义消息 (8)
- 推送&通知 (19)
- 扩展功能 (5)
- 国际化 (4)
- 音视频 (3)
- 其他 (22)
Web (36)
Server (29)
输入扩展功能板的自定义,添加与移除。
输入扩展功能板的自定义,添加与移除
发布时间: 2015-07-31 09:59
回答:
参考Demo代码
RCDChatViewController.m
/***********如何自定义面板功能*********************** // 自定义面板功能首先要继承RCConversationViewController,如现在所在的这个文件。 // 然后在viewDidLoad函数的super函数之后去编辑按钮: // 插入到指定位置的方法如下: [self.chatSessionInputBarControl.pluginBoardView insertItemWithImage:imagePic title:title atIndex:0 tag:101];
删除指定位置的方法:
[self.chatSessionInputBarControl.pluginBoardView removeItemAtIndex:0];
删除指定标签的方法:
[self.chatSessionInputBarControl.pluginBoardView removeItemWithTag:101];
删除所有:
[self.chatSessionInputBarControl.pluginBoardView removeAllItems];
更换现有扩展项的图标和标题:
[self.chatSessionInputBarControl.pluginBoardView updateItemAtIndex:0 image:newImage title:newTitle];
或者根据 tag 来更换
[self.chatSessionInputBarControl.pluginBoardView updateItemWithTag:101 image:newImage title:newTitle];
以上所有的接口都在 RCPluginBoardView.h 可以查到。当编辑完扩展功能后,下一步就是要实现对扩展功能事件的处理,放开被注掉的函数 pluginBoardView:clickedItemWithTag: 在 super 之后加上自己的处理。