简体   繁体   中英

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. 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. 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

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:

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.

If you view the preview set to an iPod touch (7th generation) the text shows just fine on the widget…

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

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…

Apparently there is an issue with text larger than 47 on widgets…

I hope this is only an issue in the simulator. I don't have a spare device to install the beta preview.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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