Post

Replies

Boosts

Views

Activity

Degrees of Gray on iOS APPS
Hi so based on Apple UIG I should use degrees of transparency to get degrees of gray ? So to apply that on a label for example or text I make them black color then apply transparency on the control element it self ? kindest Regards
1
0
957
Jan ’22
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
Getting the Locale of the System in iOS
Hi, I use the elbow code to toggle between English and Arabic locale, but the alert message always shows en_QA which is English I guess even when locale changed to Arabic ? why is that ? struct arview: View { @Environment(\.locale) private var locale @State private var showingAlert = false @State private var isLTR: Bool = false @State private var txtValue = "" var body: some View { VStack{ Text("Note Title") TextField("Place Holder", text: $txtValue) Button("Change Locale") { isLTR.toggle() } Button("Show Alert") { showingAlert = true } .alert("Current Locale: \(locale.identifier)", isPresented: $showingAlert) { Button("OK", role: .cancel) { } } } .padding() .environment (\.locale, isLTR ? Locale.init(identifier: "en" ) : Locale.init(identifier: "ar" )) } }
0
0
376
Jan ’24