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)
iOS 中如何自定义会话界面输入区扩展功能?
iOS 中如何自定义会话界面输入区扩展功能?
发布时间: 2015-11-18 16:40
回答:
自定义面板功能首先要继承 RCConversationViewController,如现在所在的这个文件。
然后在 viewDidLoad 函数的 super 函数之后去编辑按钮:
插入到指定位置的方法如下:
[self.pluginBoardView insertItemWithImage:imagePic title:title atIndex:0 tag:101];
或添加到最后的:
[self.pluginBoardView insertItemWithImage:imagePic title:title tag:101];
删除指定位置的方法:
[self.pluginBoardView removeItemAtIndex:0];
删除指定标签的方法:
[self.pluginBoardView removeItemWithTag:101];
删除所有:
[self.pluginBoardView removeAllItems];
更换现有扩展项的图标和标题:
[self.pluginBoardView updateItemAtIndex:0 image:newImage title:newTitle];
或者根据 tag 来更换
[self.pluginBoardView updateItemWithTag:101 image:newImage title:newTitle];
以上所有的接口都在 RCPluginBoardView.h 可以查到。
当编辑完扩展功能后,下一步就是要实现对扩展功能事件的处理,放开被注掉的函数
pluginBoardView:clickedItemWithTag:
在 super 之后加上自己的处理。