swiftui - SwiftUI Horizontal ScrollView 项目在 iOS 14.3 中滚动时变得不可见,但在 iOS 13 中工作正常
问题描述
SwiftUI Horizontal ScrollView 项目在 iOS 14.3 中滚动时变得不可见,但在 iOS 13 中工作正常
GeometryReader { geometry in
ZStack (alignment: .center) {
Color(UIColor(hexString: "#F2F2F7"))
.edgesIgnoringSafeArea(.all)
VStack(alignment: .center){
ScrollView (.horizontal, showsIndicators: false) {
LazyHStack {
//contents
ForEach(0..<200)
{ index in
Text(String(index))
}
}}
.frame(maxWidth: .infinity) // << here !!
.frame(height: 100)
}
}}
解决方案
罪魁祸首是 .cornerRadius(20, corners: [.topLeft, .topRight]) 将其更改为 .cornerRadius(20) 并且工作正常
推荐阅读
- python - 通过应用 RFE 选择给出最佳调整 R 平方值的特征子集
- types - 将运算符的使用限制为单个类
- keras - Keras 循环正在产生意想不到的预测结果
- c - 构建长名称C节点时Erlang主机名非法
- python - 使用 matplotlib 将一些文本显示为粗体
- kubernetes - 如何在入口中使用 DNS
- react-native - 开玩笑地模拟和监视导入的异步函数
- android-studio - AndroidStudio 不显示来自 Genymotion 的设备
- python - 通过匹配 _id 更新 MongoDB 集合
- python-3.x - 输入类型 Minhash 不支持 ufunc 'bitwise_and'