
IM即时通讯
安全可靠、全球互通

实时音视频
流畅稳定、省钱省力
回答:
参考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 之后加上自己的处理。