UITextView表情符号背景问题

发布于 2025-01-16 06:39:38 字数 357 浏览 1 评论 0原文

我有一个启用了表情符号的 UITextView 扩展,当我切换到表情符号键盘时,表情符号具有白色背景。我尝试更新 UITextView 背景颜色,从扩展中删除了自定义属性,并且还使用了默认的 UITextView,但白色背景始终存在。当我单击表情符号时,它会正确显示在 UITextView 中,而没有白色背景。这可能是什么原因造成的?

这是软键盘的截图

在此处输入图像描述

I have an UITextView extension with emoji enabled and when I switch to the emoji keyboard the emoticons have a white background. I tried to update the UITextView background color, I removed the custom attributes from my extension and I also used a default UITextView but the white background is always there. When I click on an emoticon it is correctly shown into the UITextView without the white background. What could be the cause of this?

This is the screenshot of the soft keyboard

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人事已非 2025-01-23 06:39:38

我找到了这个的原因。我将其发布在这里以防有人遇到同样的问题。我正在设置

UICollectionViewCell.appearance().backgroundColor = .white

因为外观是全局设置的,并且键盘表情符号是 UICollectionViewCell 类型,所以每个单元格都显示白色背景。

由于我的 UICollectionViewCells 有一个自定义扩展,因此我将上一行更改为

MyCollectionViewCell.appearance().backgroundColor = .white

I found the cause of this. I post this here in case someone has the same problem. I was setting

UICollectionViewCell.appearance().backgroundColor = .white

Because the appearance was set globally and the keyboard emoticons are of type UICollectionViewCell, the white background was shown for each cell.

Since I have a custom extension for my UICollectionViewCells, I changed the previous line to

MyCollectionViewCell.appearance().backgroundColor = .white
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文