add new View
This commit is contained in:
@@ -21,7 +21,7 @@ import SwiftUI
|
||||
|
||||
struct MessageCenterView: View {
|
||||
|
||||
@Environment(\.presentationMode) var presentationMode // 环境变量用于控制视图的呈现
|
||||
@Environment(\.presentationMode) var presentationMode
|
||||
|
||||
var body: some View {
|
||||
NavigationView(content: {
|
||||
@@ -31,7 +31,7 @@ struct MessageCenterView: View {
|
||||
HStack{
|
||||
Button(action: {
|
||||
|
||||
presentationMode.wrappedValue.dismiss() // 手动触发返回
|
||||
presentationMode.wrappedValue.dismiss()
|
||||
}, label: {
|
||||
|
||||
Image(systemName: "chevron.left")
|
||||
@@ -39,7 +39,7 @@ struct MessageCenterView: View {
|
||||
|
||||
Text("返回")
|
||||
.foregroundColor(.white)
|
||||
}).padding(10) // 增加可点击区域
|
||||
}).padding(10)
|
||||
Spacer(minLength: 0)
|
||||
|
||||
}
|
||||
@@ -68,7 +68,7 @@ struct MessageCenterView: View {
|
||||
})
|
||||
|
||||
.navigationBarHidden(true)
|
||||
.navigationBarBackButtonHidden(true) // 隐藏返回按钮
|
||||
.navigationBarBackButtonHidden(true)
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user