reactjs - 如何在气泡天才聊天附近添加按钮?
问题描述
我一直在使用GitedChat库,我想在右侧“回复”的气泡旁边添加一个按钮。我该怎么做?
泡泡.JS
import React from 'react';
import {Bubble} from 'react-native-gifted-chat';
export const renderBubble = props => {
return (
<Bubble
{...props}
wrapperStyle={{
left: {
backgroundColor: '#FFFFFF',
display: 'flex',
flexDirection: 'row',
borderBottomLeftRadius: 0,
},
right: {
backgroundColor: '#1D4ED8',
left: 0,
marginBottom: 15,
borderBottomRightRadius: 0,
},
}}
tickStyle={{color: 'red'}}
/>
);
};
解决方案
就在右侧renderBubble
创建Image
renderBubble(props) {
return (
<View
style={{ flex: 1, flexDirection: 'row'}}>
<Bubble
{...props}
/>
<Image
style={{
width: 30,
height: 30,
marginTop: 'auto',
bottom: 0,
}}
source={{
uri:
'https://icons-for-free.com/iconfiles/png/512/next+reply+icon-1320165657413388724.png',
}}
/>
</View>
);}
推荐阅读
- mysql - 如何在 Google Cloud Sql 副本上创建视图?
- python-3.x - 使用 Selenium 修改 HTML
- javascript - 遇到位置粘性 CSS 属性的问题
- javascript - 为什么我得到 NaN 而不是增加值?
- azure-blob-storage - CloudBlob.ExistsAsync 成本
- nginx - Nginx 仅遵循 `location /` 规则
- ruby-on-rails - 使用 Dokku 部署 Rails API 时 Procfile 错误
- node.js - 运行 npm install 时出现问题,“verb lock using...”
- amazon-web-services - AWS ECS Fargate 任务的静态出站 IP
- r - Blogdown:子目录中的 RMD 文件不会将 HTML 放在公用文件夹中