Posts

Post not yet marked as solved
0 Replies
295 Views
Good day together, I am currently trying to adjust the height of my TextEditor automatically. The whole thing should not increase further once 3 lines are reached. The whole thing is modeled after the text field in the iMessage app. Now to my problem: I'm trying to recreate the whole thing in SwiftUI and so far it works quite well, but I currently have the problem that the height of the control is not automatically adjusted and I unfortunately do not know how to do it best. Does anyone have a suggestion or even a solution for this? SwiftUI Snippet: VStack{           List{           }.listStyle(.plain)           HStack(alignment: .center){             Button{                             }label:{               Image(systemName: "plus.circle")                 .resizable()                 .frame(width: 25, height: 25, alignment: .center)             }             HStack{               TextEditor(text: $message)                 .focused($focusedField, equals: .messageView_TextEditor)                 .foregroundColor(self.message == "Message" ? .gray : .primary)                 .frame(height:35.0)                 .onTapGesture {                   if self.message == "Message"{                     self.message = ""                   }                 }                 .padding(.leading,10)                               Button{                                 }label:{                 Image(systemName: "arrow.up.circle.fill")                   .resizable()                   .frame(width: 25, height: 25, alignment: .center)                   .padding(.trailing,5)                   .foregroundColor(.green)               }             }.overlay(               RoundedRectangle(cornerRadius: 8)                 .stroke(Color.gray, lineWidth: 1)             )           }           .padding(.bottom)                                 }
Posted
by Cliplicht.
Last updated
.
Post not yet marked as solved
1 Replies
367 Views
Good day together, I am already in despair, I would like to insert a button in the NavigationBar next to the NavigationBarTitle which also automatically shrinks or enlarges. The whole thing can be seen in the App Store under the menu item "search". There, when the user scrolls down, the search bar and the title is given as .inline but not the user button. I am currently trying to implement the whole thing in SwiftUI and can't find a solution. Is there already a solution for this or if someone has the exact documentation for this case I would be very grateful for it :). thank you very much!
Posted
by Cliplicht.
Last updated
.