[iOS] navigationBarItems 바꾸기

Captainjack·2022년 3월 25일
0

TIL

목록 보기
184/258
struct ChangeName: View {
    @Binding var defaultName: String
    @State var changeprofileName: String = ""
    var body: some View {
        TextField(self.defaultName, text: $changeprofileName).modifier(ClearButton(changeprofileName: $changeprofileName))
        .navigationBarTitle("이름", displayMode: .inline)
        .navigationBarBackButtonHidden(true)
        .navigationBarItems(leading:
            HStack {
            //TODO: 닉네임을 취소로 바꾸기
                Button("취소") { }
            },trailing:
                HStack {
                    Button("저장")
                    { /*code*/ }
                }
        )
    }
}

도움된 글

**

You can create a custom back button in your navigation link by hiding native navigationBackButton. In the custom back button, you can add your translated custom back button title.

https://stackoverflow.com/a/59822675/15746954

profile
til' CTF WIN

0개의 댓글