- TabBarState ObservableObject 管理可见性 - ContentView 用 .toolbar(hidden)+animation 驱动动画 - 子页面 hideTabBarWithAnimation() 替代静态 toolbar hidden - 0.28s easeInOut 淡入淡出 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
39 lines
1.6 KiB
Swift
39 lines
1.6 KiB
Swift
import SwiftUI
|
|
|
|
struct RecallTestPage: View {
|
|
@State private var input = ""
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
Color.zxBg0.ignoresSafeArea()
|
|
ScrollView {
|
|
VStack(spacing: 16) {
|
|
Text("请回忆并写下你对「偏差-方差权衡」的理解")
|
|
.zxFontScaled(size: 14)
|
|
.foregroundColor(Color.zxF04)
|
|
TextEditor(text: $input)
|
|
.frame(minHeight: 200)
|
|
.scrollContentBackground(.hidden)
|
|
.padding(12)
|
|
.background(Color.zxFill004)
|
|
.clipShape(RoundedRectangle(cornerRadius: 14))
|
|
.overlay(RoundedRectangle(cornerRadius: 14).stroke(Color.zxBorder008, lineWidth: 1))
|
|
NavigationLink(value: Route.aiFeedback) {
|
|
Text("提交")
|
|
.font(.system(size: 14, weight: .bold))
|
|
.foregroundColor(.white)
|
|
.frame(maxWidth: .infinity)
|
|
.frame(height: 52)
|
|
.background(ZXGradient.ctaPurple)
|
|
.clipShape(RoundedRectangle(cornerRadius: 16))
|
|
}
|
|
}
|
|
.padding(.horizontal, 20).padding(.top, 8).padding(.bottom, 80)
|
|
}
|
|
.scrollIndicators(.hidden)
|
|
}
|
|
.navigationBarTitleDisplayMode(.inline).hideTabBarWithAnimation()
|
|
.toolbarBackground(.hidden, for: .navigationBar)
|
|
}
|
|
}
|