Post

Replies

Boosts

Views

Activity

Changing Modifiers by Code
Hi suppose I have 2 buttons button1 and button2 and when button2 is tapped I want to change button1 colors and it’s text, how to do that ? How to reference to button1 and change its modifiers ? now also suppose button one was a text such as Text(“Some Text”), how to change text shown between brackets when button2 is tapped ? Kindest Regards
1
0
421
Feb ’22
Text Max Character Number SwiftUI
Hi, Some times long text damage the design of views it might go to a second row and increase view height and damage the overall design, so how to solve this issue, is there a way to set a Max Characters number for Text and TextField views in SwiftUI ? and maybe show few dots as used in some designs ? Kind Regards
1
0
847
Sep ’24
Using truncationMode
Hi, The example that Apple shows in link below doesn't show how truncationMode works, because the text get truncated anyway when its length it more than frame height so what's the use of truncationMode ? https://developer.apple.com/documentation/swiftui/view/truncationmode(_:) -- Kind Regards
1
0
303
Sep ’24
SwiftUI List hidden line separator not working
Hi, I have the below code as you can see the list doesn't hide its line separator, so is it a bug ? is there any work around ? @State var flag: Bool = false var myList: [String] = ["Hello", "World", "SwiftUI"] var body: some View { VStack(alignment: .leading) { List (myList, id: \.self) { list in Text(list) } .listRowSeparator(.hidden) .listStyle(.plain) } .overlay( RoundedRectangle(cornerRadius: 10) .stroke(sysSecondary.opacity(0.4), lineWidth: 1) ) .frame(width: 220, height:260) .background(.white) .clipShape (RoundedRectangle (cornerRadius: 10)) } }
Topic: UI Frameworks SubTopic: SwiftUI
1
0
408
Sep ’24
Customizing ToolBar of SplitView
Hi, Os to possible to customize the icon, color, positioning of the SplitView ToolBar that shows at details view, the menu blue icon. add buttons to it ? change its color, icon, size ? position like adding paddings ? Kind Regards
1
0
577
Oct ’24
Using Generics with SwiftData Models and Bindable
Hi, When passing a SwftData Module to a view that receives it in a @Binadable property variable I get an error that it doesn't conform to Observation, I don't know how to solve this issue, even adding @Observable type to the generic in the structure definition won't solve it, any suggestions ? Kind Regards
1
0
503
Nov ’24