67 questions
1 vote
1 answer
49 views
Choose between 2 Layouts of custom segmented control depending on space taken in SwiftUI
In SwiftUI I need to implement scrollable segmented control: But if there are few items the available space should be spread among them: As I understand the simplest way to achieve it is to use ...
0 votes
1 answer
319 views
SegmentedControl Animation
I'm trying to make my custom segmented control. With UI and functionality I'm ok but I've some problems with animations. I want that white circle moves to new tapped value with a fluid animation ...
0 votes
2 answers
3k views
How do I select values from an enum in Kotlin and Jetpack Compose?
I'm in the process of converting my iOS app to Android. I have several enums that are used to filter an array. I have Categories (Womens, Mens, Mixed), Leagues and Divisions. In SwiftUI, I am using a ...
1 vote
2 answers
452 views
Kivymd MDSegmentedControl size
I'm trying to use the MDSegmentedControl but can't figure out how to adjust the overall width. It just runs off the screen when placed next to another widget. KV = ''' MDScreen: ...
1 vote
1 answer
182 views
Getting trouble when hovering a custom segmented control in swift
I tried to create custom segmented control which should change its look if you are hovering it. But it does not work as I expected. Here's the code (I am sorry that it is that long but I already made ...
0 votes
0 answers
554 views
Segmented regression with a single, known breakpoint in R
I'm new to this community but hope that someone will be able to help me with this issue: I am trying to find the changes of plane efficiency data after the implementation of an intervention (nudge) in ...
2 votes
1 answer
3k views
SwiftUI segmented control - how to switch to other segment on tap in first segment?
I have a segmentedControl (Picker) with two segments: struct Container: View { @State private var selectedSegment: Segment = .first var body: some View { VStack { ...
0 votes
1 answer
124 views
How do I bind an Rx Bool to selectedSegmentIndex of a SegmentedController?
I have an rx observable returning a Bool that I need to bind to a SegmentedControl's selectedSegmentIndex. The function looks like this: func getLockPower() -> Observable<Bool> { do { ...
0 votes
1 answer
536 views
How can I recognise a 'second' tap on a segmented control in SwiftUI?
In SwiftUI, I have a Picker with a .segmented style that I use to select how a list is sorted. What I want is for each segment of that picker to reverse the sort order, in addition to its normal ...
0 votes
1 answer
1k views
SwiftUI: Segmented Control scrolling
I'm using a segmented control to navigate between tabs. My issue is, when I scroll inside one tab, all the other tabs are also strolling. Which is something I don't want. I want that the scrolling ...
0 votes
2 answers
945 views
Segmented Control with a UITableView
I have a segmented control that is filled using an enum. I have a table view to show the data of each case. What is the proper way to handle this use-case rather than hardcoding switch-cases for ...
3 votes
1 answer
2k views
How to set height of segmented controller in SwiftUI?
Is there any way to change the height of segmented controller in SwiftUI or it can be achieved with only creating custom segmented controller? I tried .frame(height) but nothing has changed. I need to ...
1 vote
0 answers
409 views
Can I set the text color of individual items in a SwiftUI Segmented Picker?
I have a segmented picker in SwiftUI. I'd like each element in the picker to have its own color. I've tried this: struct ContentView: View { @State private var selectedColorIndex = 0 var body: some ...
0 votes
2 answers
512 views
UISegmentedControl not changing when state change occurs
Below I have the code for my picker: struct pickerSwitch: View { @ObservedObject var appState: AppState @State var selection: String = "Red" var colors = ["Red", "Blue&...
2 votes
0 answers
522 views
How can I have an image and text in one section of a SwiftUI SegmentedPickerStyle picker
I have a picker with segmentedPickerStyle and I want each section to have text and a small image. The problem is with the approach below I get 4 segments instead of 2. One for each text and one for ...