[英]SwiftUI AsyncImage in TabView is not showing
Images are shown without TabView but not with TabView.图像在没有 TabView 的情况下显示,但没有 TabView。
Also, I got the log below in Debug Console另外,我在调试控制台中得到了下面的日志
[UICollectionViewRecursion] cv == 0x107829812 Disabling recursion trigger logging
[UICollectionViewRecursion] cv == 0x107829812 禁用递归触发器日志记录
How can I fix it?我该如何解决?
TabView {
AsyncImage(url: URL(string: "link"))
AsyncImage(url: URL(string: "link"))
}.tabViewStyle(.page)
.frame(height: 300)
.frame(maxWidth: .infinity)
Putting the AsyncImage
into a ZStack
makes it work as stated here .将
AsyncImage
放入ZStack
使其按此处所述工作。 The reason for this is not obvious to me and I would assume it is an issue with AsyncImage
.这样做的原因对我来说并不明显,我认为这是
AsyncImage
的问题。 In any case it works with VStack
and HStack
as well.在任何情况下,它也适用于
VStack
和HStack
。 Using a simple View
with AsyncImage
as content or putting it in a Group
didn't work for me.使用带有
AsyncImage
的简单View
作为内容或将其放入Group
中对我不起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.