gpt4 book ai didi

ios - 是否有显示模态视图指示器的标准方法?

转载 作者:行者123 更新时间:2023-11-29 05:22:53 25 4
gpt4 key购买 nike

大多数 Apple iOS 应用程序的模态内容顶部都有一个小指示器:

enter image description here

我尝试寻找它,但我什至不知道如何称呼该项目。

最佳答案

这是一个模态视图指示器

import SwiftUI

struct ModalViewIndicator: View {
var body: some View {
HStack {
Spacer()
Image(systemName: "minus")
.imageScale(.large)
.font(Font.title.weight(.heavy))
.foregroundColor(Color(UIColor.tertiaryLabel))
Spacer()
}.padding(4)
}
}

struct ModalViewIndicator_Previews: PreviewProvider {
static var previews: some View {
Text("ModalViewIndicator")
.sheet(isPresented: .constant(true)) {
VStack {
ModalViewIndicator()
GeometryReader { geometry in
Image(systemName: "sun.dust.fill")
.resizable()
.frame(
width: geometry.size.width/2,
height: geometry.size.width/2,
alignment: .center
)
}
}
}
}
}

enter image description here

关于ios - 是否有显示模态视图指示器的标准方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58493192/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com