Questions tagged [segmentedcontrol]
67 questions
24
votes
2 answers
React Native - good practice: SegmentedControlIOS with ListView
What are the best practices in implementing SegmentedControllIOS with ListView? I tried three solutions, all examples contain SegmentedControllIOS with two segments and two ListView. I invite you to discuss performance of this three (maybe someone…

jonzee
- 1,600
- 12
- 20
9
votes
1 answer
Displaying Segmented Picker at Intrinsic Size in SwiftUI
In SwiftUI, a Picker of style SegmentedPickerStyle occupies the full width of its enclosing view. How can I instead have it occupy only the width it requires?
Consider this:
which is generated by the following code:
struct ContentView: View {
…

Anton
- 2,512
- 2
- 20
- 36
8
votes
4 answers
Segmented Picker with onTapGesture doesn't respond to taps
I tried to reimplement the SegmentedControlers that I was using as they became deprecated in Xcode 11 beta 5. It took a while but I got the look I wanted. However when I replaced the tapAction with an onTapGesture() then the picker stopped…

Michael Salmon
- 1,056
- 7
- 15
6
votes
2 answers
SwiftUI Segmented Control selected segment text animation on view refresh
I am experiencing the following animation of the text in the selected segment of Segmented Controls when the View is refreshed after changing some other data in the View:
Is this a bug/feature or is there a way to eliminate this behaviour?
This is…

mmklug
- 2,252
- 2
- 16
- 31
6
votes
2 answers
Gradient tint color in segmented control
I get gradient image with this method
func gradient(size:CGSize,color:[UIColor]) -> UIImage?{
//turn color into cgcolor
let colors = color.map{$0.cgColor}
//begin graphics context
UIGraphicsBeginImageContextWithOptions(size, true,…

Lavrin Pristazh
- 132
- 2
- 11
5
votes
4 answers
SwiftUI Create a Custom Segmented Control also in a ScrollView
Below is my code to create a standard segmented control.
struct ContentView: View {
@State private var favoriteColor = 0
var colors = ["Red", "Green", "Blue"]
var body: some View {
VStack {
Picker(selection:…

Learn2Code
- 1,974
- 5
- 24
- 46
4
votes
2 answers
how to set CupertinoSegmentedControl height?
I am trying to use CupertinoSegmentedControl from the flutter Cupertino library in the AppBar using the bottom attribute to achieve the following design (height = 32)
so I tried the following :
@override
Widget build(BuildContext context) {
…

DOGGA Nidhal
- 43
- 2
- 4
4
votes
2 answers
How to make segmented control with menu like in the Xcode toolbar
I'd like to add a segmented control with menu like in Xcode toolbar to my OS X app. It will switch between three screens and also needs to have some options in each screen in the form of menu.
The standard segmented control does not allow "Select…

Alexander B
- 407
- 2
- 17
3
votes
1 answer
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 increase the height of segmented…

Abrcd18
- 155
- 1
- 13
3
votes
1 answer
How to disable Segmented control in Android?
Can any one please tell me, how to disable segmentedcontrol in android.
I have been using Foursquared library.
The link for library is given below.

Alps Rana
- 61
- 7
2
votes
1 answer
Designing issue with Flutter's CupertinoSlidingSegmentedControl?
The first image is what I'm trying to make, but using flutter CupertinoSlidingSegmentedControl does not allow to add border radius.
the second image is what I have made so far.
I want to add border radius to my CupertinoSlidingSegmentedControl…

safiya
- 40
- 2
- 6
2
votes
1 answer
SwiftUI: control zIndex on views with matchedGeometryEffect
I am building a custom SegmentedPicker in SwiftUI where the selector adjusts its size to fit the frame of each picker item. I did it already using PreferenceKeys as inspired by this post (Inspecting the View Tree) for uniformly sized items like…

seriouslysupersonic
- 340
- 4
- 8
2
votes
1 answer
Segmented control in react native doesn't contain the same value in event and my state
I have issue with SegmentedControl component in React Native.

Rtransat
- 43
- 6
1
vote
0 answers
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:
MDCard:
MDLabel:
size_hint:…

cryptotheo
- 151
- 1
- 7
1
vote
1 answer
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 it 200 lines shorter then it was):
class…

Michaelll
- 37
- 6