简体   繁体   English

SwiftUI iOS 14.2 beta,文本从中型和大型主屏幕小部件中消失?

[英]SwiftUI iOS 14.2 beta, text disappearing from medium and large home screen widget?

Anyone else notice text disappearing from medium and large widget sizes?还有其他人注意到中型和大型小部件尺寸中的文本消失了吗? Small widget sizes working fine.小部件尺寸工作正常。

I have an app in the store and have been waiting for an iOS update to fix the flickering widget problem on iOS 14.0.1.我在商店里有一个应用程序,一直在等待 iOS 更新来修复 iOS 14.0.1 上闪烁的小部件问题。 I tried the Xcode beta to see if the 14.2 beta fixed the flickering issue, and it looks like it did, BUT now I'm seeing an issue where text shows for a split second and then fades to be completely transparent.我尝试了 Xcode 测试版,看看 14.2 测试版是否解决了闪烁问题,看起来确实如此,但现在我看到一个问题,文本显示一瞬间,然后逐渐消失,完全透明。 If you swipe left or right to another page on the home screen, then swipe back, the text shows up again for a split second and then disappears again.如果您向左或向右滑动到主屏幕上的另一个页面,然后向后滑动,文本会再次出现一瞬间,然后再次消失。

Anyone else noticing this issue?还有其他人注意到这个问题吗?

Here is a video clip to show what I'm trying to describe.这是一个视频剪辑,用于显示我要描述的内容。 I set it up to show a medium sized widget on top and a small sized widget just below it so you can see that the issue doesn't seem to effect the small sized widget and you can get an idea on what the medium widget should look like.我将其设置为在顶部显示一个中型小部件,在其下方显示一个小型小部件,因此您可以看到该问题似乎并未影响小型小部件,您可以了解中型小部件的外观像。 https://youtu.be/h8szHHXavNo https://youtu.be/h8szHHXavNo

I did some testing and found it is related to the text size and what simulator / preview device you have selected…我做了一些测试,发现它与文本大小和您选择的模拟器/预览设备有关......

Start a new SwiftUI project in Xcode 12.2 beta 2 Add a Widget extension Set the text in the body of the widget's view to 48, example:在 Xcode 12.2 beta 2 中新建一个 SwiftUI 项目 添加一个 Widget 扩展 将 widget 视图的 body 中的文本设置为 48,示例:

var body: some View {
    Text(entry.date, style: .time)
        .font(.system(size: 48))
}

If you view the preview set to an iPhone 11 Pro Max, the preview will show no text on the widget.如果您查看设置为 iPhone 11 Pro Max 的预览,则预览将不会在小部件上显示任何文本。

If you view the preview set to an iPod touch (7th generation) the text shows just fine on the widget…如果您查看设置为 iPod touch(第 7 代)的预览,则文本在小部件上显示得很好......

To prove it isn't the text being too large to fit on the widget, you can change it to:为了证明它不是文本太大而不适合小部件,您可以将其更改为:

var body: some View {
    Text("T")
        .font(.system(size: 48))
}

And it will still show on the iPod touch, but not show on the iPhone 11 Pro Max而且它仍然会显示在 iPod touch 上,但不会显示在 iPhone 11 Pro Max 上

Also, if you make text size 47, all of a sudden it shows up on both the iPhone 11 Pro Max and iPod touch previews…此外,如果您将文本大小设置为 47,它会突然出现在 iPhone 11 Pro Max 和 iPod touch 预览中……

Apparently there is an issue with text larger than 47 on widgets…显然小部件上的文本大于 47 存在问题......

I hope this is only an issue in the simulator.我希望这只是模拟器中的一个问题。 I don't have a spare device to install the beta preview.我没有备用设备来安装 Beta 预览版。

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

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