在 Swift 中将字体大小更改为 25 时标签消失

2023-09-10移动开发问题
3

本文介绍了在 Swift 中将字体大小更改为 25 时标签消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有一个表格视图和里面的两个标签.第二个标签(描述标签)有数百行.当我将描述标签的字体大小设置为 21 时,它正在工作.当我将字体大小更改为 25 时,为什么描述标签会消失?如何解决?我还设置了自动调整单元格高度以增加尺寸.

描述标签属性检查器另外代码截图是

尺寸为 25 时消失标签的图像

标签仅在框架低于 8000 时显示文本,并且不显示更多文本.

对于较低的标签设置这个.

并且在属性检查器中将两个标签的 lines 设置为 0.并请实现索引行的高度和估计的高度 tableview 代表.

I have a table view and two labels inside it. The second label(description label) has Hundreds of line. when I set font size of description label to 21 it's working. Why description label goes to dissappear when I am changing font size to 25? How to resolve it? I have also set auto resize cell height for increase size.

description label attribute inspector alse code screenshot is

image for disappear label when size is 25

label only show text when frame is under 8000 and for more text is not showing.

github link for problem

解决方案

@dineshsharma.. Lets try this one and let me know if you are still facing the problem. This is for top label.

And for lower label set this.

And in attribute inspector set lines to 0 for both labels. And please implement height for row at index and estimated height tableview delegates.

这篇关于在 Swift 中将字体大小更改为 25 时标签消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

Cocos2d 字体:如何为 CCLabelBMFont 创建 .fnt 文件?(任何免费的位图字体创建工具?)
Cocos2d font : How to create .fnt file for CCLabelBMFont? ( Any free bitmap font creation tool ? )(Cocos2d 字体:如何为 CCLabelBMFont 创建 .fnt 文件?(任何免费的位图字体创建工具?))...
2024-08-12 移动开发问题
2

如何从 CCScrollView 上的按钮更改标签文本?
How to change labels text from a button on a CCScrollView?(如何从 CCScrollView 上的按钮更改标签文本?)...
2024-08-12 移动开发问题
6

cocos2d中如何在CCLabelTTF中设置背景色
How to set background color in CCLabelTTF in cocos2d(cocos2d中如何在CCLabelTTF中设置背景色)...
2024-08-12 移动开发问题
5

使用自定义字体文件创建 CCMenuItemLabel
create a CCMenuItemLabel with a custom font file(使用自定义字体文件创建 CCMenuItemLabel)...
2024-08-11 移动开发问题
6

更新 Cocos2d 中的标签值
Update Label Value in Cocos2d(更新 Cocos2d 中的标签值)...
2024-08-11 移动开发问题
9

无法将文件从捆绑包复制到 iOS 中的文档目录
Can`t copy file from bundle to documents directory in iOS(无法将文件从捆绑包复制到 iOS 中的文档目录)...
2024-04-15 移动开发问题
4