简体   繁体   English

iOS15,每次单击另一个列表的文本时,文本之间的链接都会消失

[英]iOS15, link between text is disappear every time when I click on another list’s text

I got a strange issue with iOS app as I'm upgrade some of the code for iOS 15我在升级 iOS 15 的一些代码时遇到了一个关于 iOS 应用的奇怪问题

this issue is only happening to one text line “Setting” in the list此问题仅发生在列表中的一个文本行“设置”中

this is code I'm using这是我正在使用的代码

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    FLTAccountTVCell *cell = [tableView dequeueReusableCellWithIdentifier:kFLTAccountTVCellReuseId];

    if (!cell) {
        cell = [[FLTAccountTVCell alloc] initWithReuseIdentifier:kFLTAccountTVCellReuseId];
        cell.textLabel.font = [FLTStylesheet regularFontWithSize:kFontSizeMedium];
    }

    cell.textLabel.text = [self titleForCellAtIndexPath:indexPath];
    return cell;
}

FLTAccountTVCell is subclass of UITableViewCell FLTAccountTVCell 是 UITableViewCell 的子类

all seems fine apart from one “Settings” text is keep disappear when I click any list of it.除了一个“设置”文本之外,一切似乎都很好,当我单击它的任何列表时,它会一直消失。 I have tested it on ios14 and lower and it seems all fine apart from ios15 and missing “Settings”我已经在 ios14 及更低版本上对其进行了测试,除了 ios15 和缺少“设置”之外,它似乎一切都很好

Please see Screenshot Gif below请参阅下面的截图 Gif

在此处输入图片说明

We reused this code to the already allocated UI elements which are same.我们将此代码重用于已分配的相同 UI 元素。

In our case, the list of options are same ui, so to improve performance we are using this coding practice to not allocate more memory to the same UI elements.在我们的例子中,选项列表是相同的 ui,所以为了提高性能,我们使用这种编码实践来不为相同的 UI 元素分配更多的内存。

But somehow this reusable practice didn't work well on IOS 15 to drop this idea of reusable UI elements and allocate free memory for each UI list element and it worked但不知何故,这种可重用的做法在 IOS 15 上效果不佳,放弃了可重用 UI 元素的想法,并为每个 UI 列表元素分配了可用内存,但它奏效了

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    FLTAccountTVCell *cell = [tableView dequeueReusableCellWithIdentifier:kFLTAccountTVCellReuseId];

    if (!cell) {
        cell = [[FLTAccountTVCell alloc] initWithReuseIdentifier:kFLTAccountTVCellReuseId];
        cell.textLabel.font = [FLTStylesheet regularFontWithSize:kFontSizeMedium];
    }

    cell.textLabel.text = [self titleForCellAtIndexPath:indexPath];
    return cell;
}
FLTAccountTVCell is subclass of UITableViewCell

It's not good coding practice, but it's fine.这不是一个好的编码习惯,但它很好。 The list of UI elements fixed.修复了 UI 元素列表。 When the list is dynamic like search results, this reusable coding practice is useful cos of many lists.当列表像搜索结果一样是动态的时,这种可重用的编码实践对于许多列表来说都是有用的。

Account setting options fixed and not required reusable elements.帐户设置选项已修复,不需要可重复使用的元素。 I believe that it's some kind of ios 15 issue and in future release it will fix.我相信这是某种 ios 15 问题,在未来的版本中它会修复。 Like in ios 15.1 maybe?就像在 ios 15.1 中一样?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM