android - 画一个讲话泡泡
问题描述
我尝试使用以下代码在 Android 画布中绘制语音气泡,
private void drawBubble() {
path.reset();
path.moveTo(bounds.left, bounds.bottom);
float percentage20 = bounds.height() * (20.0f / 100.0f);
path.lineTo(bounds.left + percentage20, bounds.bottom - percentage20);
RectF arcRect = new RectF(bounds.left, bounds.top, bounds.right, bounds.bottom - percentage20);
path.addArc(arcRect, 130, 330);
path.lineTo(bounds.left, bounds.bottom);
}
但这给了我以下输出。
正如您在这张图片中看到的,我无法将线与气泡连接起来。有人可以将我重定向到正确的路径吗?
更新
我改为addArc
,arcTo
现在我的输出是,
解决方案
推荐阅读
- kotlin - 如何在 Kotlin 中创建没有支持字段的外部属性?
- html - FullCalendar - React - 加载功能问题
- android - 如何使用改造连接到我在 Realt 设备中的本地 REST API
- python - 如何使用公式计算梯度
- qt - 工作 QSignalMapper 代码阅读起来很笨拙
- java - 是否可以使用空字段进行 GET 调用以从数据库中检索信息?
- python - VScode 要求使用代码运行器或终端运行 python 代码
- javascript - 如何使用 javascript 更改 iframe 的 src?
- c++ - 制作缺少参考链接的 Visual Studio C++ 项目 OK
- javascript - 为什么我的 Vuex 模块不工作?[vuex] 未知突变类型:moduleName/mutation