Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

MessageLabel cuts off text

未关闭
#1,720 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
swift
领域
mobile-dev

调研方向

首先,在列出的 iOS 版本上运行链接的 MessageKitIssue 测试项目,并将 MessageLabel 与 UILabel 进行比较。阅读 MessageLabel.swift,重点关注 paragraphStyle 属性所在的行,并将其尺寸计算与 MessageSizeCalculator.labelSize 进行比较。当完整文本在复现项目中保持可见时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug?

First of all thank you for the great library. I found the issue when MessageLabel cuts off text.
I also prepared you test project where you can easy to reproduce it. In the example I use the same method for calculation label size that we have in MessageSizeCalculator.labelSize

I found that this issue is cased by this line

mutableText.addAttribute(.paragraphStyle, value: style, range: range)

inside MessageLabel.swift file

To Reproduce
Just run test project you will see that the text is cutting off in contrast of regular UILabel

Expected behavior
Whole text should be visible

Screenshots
https://www.screencast.com/t/6ECllmkScpC

Environment

  • What version of MessageKit are you using?
    I use main branch (6.1.0)
  • What version of iOS are you running on?
    iOS 14.7.1, iOS 15.2
  • What version of Swift are you running on?
    xCode 13.2.1, swift 5
  • What device(s) are you testing on? Are these simulators?
    It's possible to reproduce this issue on simulator and real devices
    15.2(any simulator),
    15.2 (iPhone 11)
    14.7.1 (iPhone 6s)
  • Is the issue you're experiencing reproducible in the example app?
    Yes, please use my project https://github.com/Pro2005/MessageKitIssue to understand the problem

Please help me to find correct solution because you know project better.

主要语言
Swift
星标
6.3k
派生
1.2k
平均合并
12 小时 4 分钟
30 天内合并 PR
9

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

MessageKit/MessageKit 的其他 Issue

查看 MessageKit/MessageKit 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。