Questions tagged [segmentedcontrol]

67 questions
0
votes
1 answer

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 { do { return try doorModeService.getDoorLockPower().map {…
Joakim Sjöstedt
  • 824
  • 2
  • 9
  • 18
0
votes
1 answer

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 behaviour. Below is an example of a list with a…
gbroekstg
  • 1,055
  • 1
  • 10
  • 19
0
votes
1 answer

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 works only inside the selected tab and when I click…
Theoutsider
  • 63
  • 1
  • 7
0
votes
2 answers

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 numberOfRowsInSection and cellForRowAt? let…
Artiom
  • 513
  • 1
  • 4
  • 15
0
votes
2 answers

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"] init(appState: AppState) { print("Init ran again") …
nickcoding2
  • 142
  • 1
  • 8
  • 34
0
votes
0 answers

Change Segmented Control inner padding iOS 13

UISegmentedControl looks great in iOS 13 and the animations it provides are awesome but I need to increase the inner padding to match my design. What I have (font is already set in code): How it should look (ideally): Is there any way to achieve…
Dante Puglisi
  • 648
  • 7
  • 24
0
votes
1 answer

How to rotate Title Label of Segmented Control with Swift

I rotated a Segmented Control in swift, in order to have a vertical Control. but I wanna rotate the Title Label in 90 degrees With this code, I can change Title text and color (in Red) as well, but I can't rotate Label, I don't know why. for view…
Adrian
  • 197
  • 1
  • 8
0
votes
1 answer

mapType SwiftUI Button/SegmentedControl

Looking for the best option to change mapType on button/segmented control selection. Currently I have the below code which is working to a degree, however the picker options always rotate. How can I keep it consistent as Standard, Satellite, Hybrid…
0
votes
1 answer

Change UISegmentedControl.selectedIndex value depending on which UICollectionViewCell is currently shown

how can I change the UISegmentedControl.selectedIndex value depending on which UICollectionViewCell is currently shown? My collectionView has the isPagingEnabled set to true, and I can easily select a different item depending on the selected index…
Vipera74
  • 227
  • 3
  • 17
0
votes
1 answer

Dark and light not switching with segmented control (Swift)

Well I'm trying to make a light and dark theme for a cookie clicker with segmented index but when i switch nothing happens and im really confused if anyone could help me i would really appreciate it. Ive tried changing else if. Removing code just…
0
votes
1 answer

How to dynamically change a collectionView Item size (like instagram) using segmented control

How can I build a UICollectionView similar to the Instagram one? I already created the three columns one: let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout() let width = (view.frame.width/3)-2 myCollectionView =…
Vipera74
  • 227
  • 3
  • 17
0
votes
1 answer

Gradient color segmented control in xamarin forms

I need your help. I want to do gradient background color segmented controls in xamarin forms like this screenshot. How can i do that? Any idea? Thank you. Alternative link: Alternative link
muhammetsahin
  • 181
  • 4
  • 14
0
votes
1 answer

How to dinamically change values in labels in a SegmentedControl? Swift 4, iOS

I have some issues with the implementation of a segmented control. I come to you (the more experienced people) to get some advice about what I should do in order to fix this. Here I go: For "current" tab, the "Panel's optimal azimuth" and "Panel's…
0
votes
1 answer

Radio button deselects itself on clicking anywhere on the page

I am trying to implement segmented control button instead of normal radio button in Angular Although If i remove CSS class, normal radio button is working fine and remain selected on navigating to another page os clicking anywhere on the same page,…
0
votes
1 answer

UITableView inside a custom UIView in segmented control does not show the JSON value in custom cell

I have a Segmented control with a UIView in it as shown below: I have added two custom views inside UIView by the following code: class NotificationViewController: UIViewController { @IBOutlet weak var viewContainer: UIView! //create a variable…
TheSwiftGuy77
  • 656
  • 1
  • 9
  • 25