Quantcast
Channel: Active questions tagged uipickerview - Stack Overflow
Viewing all 593 articles
Browse latest View live

UIPickerView selection input Swift 4 or 5

$
0
0

I have a UIPickerView that selects from an array of states and the last item in the array is “outside the US”. When the last item in the array is selected I want to show another input option for country.

Currently I have the country input set to hidden in viewDidLoad.

This is my attempt at trying to get this to work, but it keeps causing a crash on selection of the last item.

var stateOptionsList = ["", "Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "District Of Columbia", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming", "Outside The United States"]

let outsideOfUS = stateOptionsList[statePicker.selectedRow(inComponent: 52)] as String

print(outsideOfUS)

if selectStateInput.text == outsideOfUS {
    countryContainer.isHidden = false
} else {
    countryContainer.isHidden = true
}

I put the let outsideOfUs var in the pickerView didSelectRow. Not sure if this is where I am supposed to put this.


Swift: Reading from an UIPickerVIew

$
0
0

I'm trying to read ints from an UIPickerView, I've already done this but it's only a print on an UILabel. this time I need the data so I can put sounds for each number, so I can make a queue announcer (it's a 3-digit UIPickerView and starts from "001" to "999". see I don't know the code to give each component's selected number a sound. (I've already imported the sounds via AVFoundation but I won't paste it here in my code). And as I've mentioned in the comments, Converting isn't my problem. So this question is new. Here's what I have so far:

import UIKit
import AVFoundation

class ViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate {
    //Picker View Settings
    @IBOutlet weak var label: UILabel!
    @IBOutlet weak var pickerView: UIPickerView!

    let numbers = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]

    func numberOfComponents(in pickerView: UIPickerView) -> Int {
       return 3
    }

    func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
       return numbers[row]
    }

    func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
       return numbers.count
    }

    func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
        let val1 = numbers[pickerView.selectedRow(inComponent: 0)]
        let val2 = numbers[pickerView.selectedRow(inComponent: 1)]
        let val3 = numbers[pickerView.selectedRow(inComponent: 2)]

        label.text = "\(val1) \(val2) \(val3)"
    }

    //"Next" Button Setting 
    fileprivate func num(_ i: Int) -> Int {
        return pickerView.selectedRow(inComponent: i)
    }

    @IBAction func buttonPressed() {
        let currentNum = num(0) * 100 + num(1) * 10 + num(2)
        let nextNum = currentNum + 1

        pickerView.selectRow(nextNum % 1000 / 100, inComponent: 0, animated: true)
        pickerView.selectRow(nextNum % 100 / 10, inComponent: 1, animated: true)
        pickerView.selectRow(nextNum % 10, inComponent: 2, animated: true)

        changeLabelText()
    }

    fileprivate func changeLabelText() {
        label.text = "\(num(0)) \(num(1)) \(num(2))"
    }

    //Announcer Button
    @IBAction func soundPlayed(_ sender: Any) {
        //Don't have any function yet, because of my question.
    }

passing Json array to UIPickerView Not working

$
0
0

i get data form JSON . Like this

-(void)connectionDidFinishLoading:(NSURLConnection *)connection
{

   al=[NSJSONSerialization JSONObjectWithData:webData options:0 error:nil];
    NSLog(@"String String %@",al);

    for (array in al) {
        NSLog(@"array is  array %@",array);
    }
}

PickerView Methods:-

- (NSInteger)numberOfComponentsInPickerView:
(UIPickerView *)pickerView
{
        return 1;
}

- (NSInteger)pickerView:(UIPickerView *)pickerView
      numberOfRowsInComponent:(NSInteger)component
{
        return array.count;
}

- (NSString *)pickerView:(UIPickerView *)pickerView
titleForRow:(NSInteger)row
forComponent:(NSInteger)component
{
    return array[row];
}

I tried like this but it's showing empty PickerView.So Please give me any idea.

My Json like this:

[[1,"Hyd"],[2,"viz"]]

How can add a UIPickerView in a UIAlertController?

$
0
0

enter image description here

I've created a UIAlertController with a UITextfield and a UIPickerview.

When I press the button to present the UIAlert the UIPickerView is totally displaced. How can I fix it?

Here's my code:

func numberOfComponents(in pickerView: UIPickerView) -> Int {
           return 1
       }
    func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
        return passwordCategory.count
    }
    func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
        passwordCategory[row]
    }




 func passwordAlert() {
        let alert = UIAlertController(title: "type in some text", message: "", preferredStyle: .alert)
        alert.addTextField { (passwordCategoryTextfield) in
            passwordCategoryTextfield.placeholder = "e.g Business"
        }
        let pickerFrame = CGRect(x: 0, y: 0, width: 250, height: 300)
        let picker = UIPickerView(frame: pickerFrame)
        picker.delegate = self
        picker.dataSource = self
        alert.view.addSubview(picker)
        alert.addAction(UIAlertAction(title: "add", style: .default, handler: { (action) in
            alert.dismiss(animated: true, completion: nil)
            let passwordInfo = alert.textFields?.first?.text
            self.individualPasswordInformaiton.insert("\(passwordInfo ?? "")", at: 0)
            print(self.individualPasswordInformaiton)
        }))

        alert.addAction(UIAlertAction(title: "cancel", style: .cancel, handler: { (action) in
            alert.dismiss(animated: true, completion: nil)

        }))


        self.present(alert, animated: true, completion: nil)

    }

How to build a user profile page with Xcode

$
0
0

As part of an app I am building, I want to incorporate a user profile page. it should have am image view for a picture, a label for the alias/ userName, and a picker view with a selection of countries so you can pick the nationality. how would you go around building it ? table view ?

I have tried using a view controller, with a table view and table view cell attached. I put an image view and a label above the table view.

I also added a picker view inside of the cell.

however the result did not work.

How to make element in UIPickerView not clickable or "disable" it [duplicate]

$
0
0

This question already has an answer here:

I have a UIPickerView which has lets say 4 Elements in it, now if one element is selected, I want that one Element to not be selectable anymore. I have managed to gray out the already selected ones, however they are still selectable. How can I make these rows not clickable or disable them?

func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
        if pickerView.tag == 300 {
            if selectedCourseLeads.contains(courseLeads[row]) {
                pickerView.selectRow(row + 1, inComponent: 0, animated: true)
            }
            return courseLeads[row].firstName + " " + courseLeads[row].name
        }
        else {
            return courseHelpers[row].firstName + " " + courseHelpers[row].name
        }
    }

Here the already selected elements are grayed out under the if statement which compares both arrays.

The item appearing when I open my UIPickerView is not considered "selected"

$
0
0

When I open my UIPickerView the item appearing is not considered selected in didSelectRow, I have to move up and down and reselect it

This is an extra step for the user if the item appearing is the item he/she actually wants to select

Is there a workaround that I can use to prevent this?

I've tried pickerView.selectRow(selectedRow, inComponent: 0, animated: false) which actually let me display the right item but whatever is displayed is not picked up by pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int)

Here's how I build my picker:

customPickerView = UIPickerView()
customPickerView.delegate = self
textField.inputView = customPickerView
customPickerView.backgroundColor = UIColor(named: "whiteToBlack")
slwpDatesPickerData = dateArrayRange(inclusiveStartDate: Date(), inclusiveRange: 10)
customPickerView.selectRow(0, inComponent: 0, animated: false)

UIPickerView where selected 1st component decides contents of 2nd component is out of sync

$
0
0

I have encountered some synchronisation/graphic update problems with my UIPickerView.

I want a view with 2 components, where the content of the second component depends on the selected row of the first component.

My code is inspired from: Swift UIPickerView 1st component changes 2nd components data

However, while it seems to work, sometimes (not every time) there are some visual problems, as seen on the screenshots below. (on the second screenshot, you can see that the rows of the second component are not really correct, and are a mix of the rows from the first and the second component)

Here is the code:

import UIKit

class AddActivityViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource {

    @IBOutlet weak var typePicker: UIPickerView!
    var pickerData: [(String,[String])] = []


    override func viewDidLoad() {
        super.viewDidLoad()

        self.typePicker.delegate = self
        self.typePicker.dataSource = self

        pickerData = [("sport",["bike", "run", "soccer", "basketball"]),
                      ("games",["videogame", "boardgame", "adventuregame"])]

        // not sure if necessary
        typePicker.reloadAllComponents()
        typePicker.selectRow(0, inComponent: 0, animated: false)

//        pickerData = [("sport",["bike", "run", "soccer"]),
//        ("games",["videogame", "boardgame", "adventuregame"])]
    }

    // number of columns in Picker
    func numberOfComponents(in pickerView: UIPickerView) -> Int {
        return 2
    }

    // number of rows per column in Picker
    func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
        print("function 1 called")
        if component == 0 {
            return pickerData.count
        } else {
            let selectedRowInFirstComponent = pickerView.selectedRow(inComponent: 0)
            return pickerData[selectedRowInFirstComponent].1.count
        }
    }

    // what to show for a specific row (row) and column (component)
    func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
        print("function 2 called with values: component: \(component), row: \(row)")
        if component == 0 {
            // refresh and reset 2nd component everytime another 1st component is chosen
            pickerView.reloadComponent(1)
            pickerView.selectRow(0, inComponent: 1, animated: true)

            // return the first value of the tuple (so the category name) at index row
            return pickerData[row].0
        } else {
            // component is 1, so we look which row is selected in the first component
            let selectedRowInFirstComponent = pickerView.selectedRow(inComponent: 0)

            // we check if the selected row is the minimum of the given row index and the amount of elements in a given category tuple array
            print("---",row, (pickerData[selectedRowInFirstComponent].1.count)-1)
            let safeRowIndex = min(row, (pickerData[selectedRowInFirstComponent].1.count)-1)
            return pickerData[selectedRowInFirstComponent].1[safeRowIndex]
        }
        //return pickerData[component].1[row]
    }

    func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
        // This method is triggered whenever the user makes a change to the picker selection.
        // The parameter named row and component represents what was selected.
    }
}

Is this a problem with my code or generally a complicated aspect of UIPickers that can not be trivially solved?

Additionally, is there a nicer way to develop this functionality?

initial view

view out of sync


How to make UIPickerView not to display if delegate data is empty on textfield touch?

$
0
0

I do not want to display UIPickerView if statusArray is empty when user touch up inside the text field for start editing. My requirement is after entering 3 characters, I'm going to make a web service call. In main app, I received all the response data & display on UIPickerView. Please suggest me how to hide UIPickerView till I received response from server.

enter image description here

Here is my sample code (web service call not included)

import UIKit

class ViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate {


@IBOutlet weak var statusText: UITextField!

let statusArray  = [String]()
let picker = UIPickerView()

override func viewDidLoad() {
    super.viewDidLoad()

    picker.dataSource = self
    picker.delegate = self


    //binding textfield to picker view
    statusText.inputView = picker


}

func numberOfComponents(in pickerView: UIPickerView) -> Int {
    return 1
}

func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
    return statusArray.count
}


func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
    return statusArray[row]
}
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
    statusText.text = statusArray[row]
}

}

//callback method from web service

DispatchQueue.main.sync {

for location in locationDetails.ianaLocationInfoArray
{


    let optionToView = location.ianaCode! + " - " + location.facilityName!
    self.locationArray.append(optionToView)
    self.picker.reloadAllComponents()





}
     applicationUtils.hideActivityIndicator(uiView: self.view)
}  

Does not conform to protocol UIPickerViewDataSource

$
0
0

I don't know what's wrong with my code. I tried to follow the tutorial but same error happen.

Error:

Type 'FourthViewController' does not conform to protocol 'UIPickerViewDataSource'

Here is my code:

import UIKit

let characters = ["Jaja Bink", "Luke", "Han Solo", "Princess Leia"];

let weapons = ["LightSaber", "Pistol", "Keris"];

class FourthViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate {

    @IBOutlet weak var doublePicker: UIPickerView!

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int {
        return 2
    }


    func pickerView(pickerView: UIPickerView,
                    titleForRow row: Int,
                                forComponent component: Int) -> String? {

        if component == 0 {
            return characters[row]
        } else {
            return weapons[row]
        }

    }

    func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int? {
        if component == 0 {
            return characters.count
        } else {
            return weapons.count
        }
    }

}

programmatically stop uipickerview animation on iphone

$
0
0

I have a UIActionSheet containing a picker and a UIToolbar. On the UIToolBar there is a save button. However, some of my users reported pressing the save button before the UIPickerView stops spinning thus only retrieving the initial value (before spinning).

Is there a way to get the currently selected item of the UIPickerView once the user taps save or get feedback of the active selected item while it's spinning?

Thanks

iOS 13 UITextField inputView with UIPickerView causing app to not be interact-able

$
0
0

I have the following code that worked before for making a UITableView cell tap to show a UIPickerView on screen:

fileprivate var hiddenField: UITextField = UITextField(frame: .zero)

override func viewDidLoad() {
    //...
    hiddenField.delegate = self
    view.addSubview(hiddenField)
}

func selectYear() {
    let yearPicker = UIPickerView()
    yearPicker.dataSource = self
    yearPicker.delegate = self

    hiddenField.inputView = yearPicker
    hiddenField.becomeFirstResponder()
}

However on iOS 13.1 simulator this code now makes it so that I can't tap anywhere in the app (can't scroll the picker view, or tap anywhere else), but the simulator is responsive since I can swipe up on the home indicator to close the app.

Did anything change regarding how this code might run on iOS 13 vs previously?

swift UIAlertController with pickerView button action stay up

$
0
0

I am new in swift and I am trying to make UIAlertContoller with PickerView but I have problems with the Buttones, Here a photo

enter image description here

I am trying to change the constraint of the buttons to stay up. I read a lot of answers here but I did not find any solution

Here is my code:

func distance(){
    let editRadiusAlert = UIAlertController(title: "Choose distance", message: "", preferredStyle: UIAlertControllerStyle.alert)
    let pickeViewFrame: CGRect = CGRect(x: 0, y: 0, width: 250, height: 300)
    let pickerViewRadius: UIPickerView = UIPickerView(frame: pickeViewFrame)
    pickerViewRadius.delegate = self
    pickerViewRadius.dataSource = self
    editRadiusAlert.view.addSubview(pickerViewRadius)
    editRadiusAlert.addAction(UIAlertAction(title: "Done", style: UIAlertActionStyle.default,handler:nil))
    editRadiusAlert.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.cancel, handler: nil))
    editRadiusAlert.view.addConstraint(NSLayoutConstraint(item: editRadiusAlert.view, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: self.view.frame.height * 0.5))
    self.present(editRadiusAlert, animated: true, completion: nil)
} 

Can't change selected view in Picker View

$
0
0

I can't change the selected view from pickerView when it is shown for the first time.

Also, I tried to call the didSelectRow delegate method directly after the selectRow method in viewDidLoad, but nothing happens.

When I normally swipe the picker it works as expected - selected item changed as described in didSelectRow method.

But I can't figure how to change the selected view for the first time, without user interaction.

// start - pikerView

let viewStart = self.start.view(forRow: self.startInex, forComponent: 0)
viewStart?.backgroundColor = .red

Multi-Component Picker (UIPickerView) in SwiftUI

$
0
0

I'm trying to add a three-component Picker (UIPickerView) to a SwiftUI app (in a traditional UIKit app, the data source would return 3 from the numberOfComponents method), but I can't find an example of this anywhere.

I've tried adding an HStack of three single-component Pickers, but the perspective is off from what it would be if they were all part of a single Picker.


PickerView fontsize change accordingly iOS Swift

$
0
0

should look like this In pickerView i want to change title font size, as I scroll the selected row title font will be of high font size and above selected title font size will be decreasing and same for below selected row.

 import UIKit

Vc:

class ViewController: UIViewController {
    @IBOutlet weak var pickerView: UIPickerView!
    var pickerTitle = ["10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00","10:00"]. // time to display in pickerView

var fontSize = [4,6,8,10,12,14,16,18,20,22,24,26,24,22,20,18,16,14,12,10,8,6,4,2] // font size when view is loaded and when I scroll I need to change the font size so this won't work I guess
override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view.
    pickerView.delegate = self
    pickerView.dataSource = self

    pickerView.reloadAllComponents()
    pickerView.selectRow(11, inComponent: 0, animated: true)
}
}

datasource and delete for pickerView:

 extension ViewController: UIPickerViewDelegate,UIPickerViewDataSource {
func numberOfComponents(in pickerView: UIPickerView) -> Int {
    return 1
}

func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
    return pickerTitle.count
}


func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
    let pickerLabel = UILabel()
    let titleData = pickerTitle[row]

    let myTitle = NSAttributedString(string: titleData, attributes: [NSAttributedString.Key.font:UIFont(name: "Georgia", size: CGFloat(fontSize[row]))!,NSAttributedString.Key.foregroundColor:UIColor.black])
    pickerLabel.attributedText = myTitle

    pickerLabel.textAlignment = .right
        return pickerLabel
}

func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
    for var i in 0...row{
        print(i)
    }

    for var i in row..<pickerTitle.count{
        print(i)
    }
    pickerView.reloadAllComponents()
}   
}

How to make a UIDatePicker appear at bottom of screen?

$
0
0

I currently use MonoTouch with MonoTouch.Dialog. When tapping on a date field it pushes the navigationcontroller so you go right a screen to see your UIDatePicker where you choose the date then go "back" to the main screen again. I'd really like to have this UI like other apps I've used that when you select a date field the UIDatePicker appears at the bottom of the current screen.

I would like to learn how to do this and apply it to other input fields where I may want to use a custom picker that also presents itself at the bottom of the current screen.

Does anyone have any code to share that would allow a UIPicker/UIDatePicker to appear at the bottom of the active screen?

Thank you.

for loop in titleForRow in pickerView not working

$
0
0

I was creating a clock pickerView and used the following:

var countSec = Array(0...10)
var countMin = Array(0...59)
var countHour = Array(0...59)

func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
    if component == 0{
        for count in countSec {
            return "\(count)"
        }
    }else{
        for count in countMin{
            return "\(count)"
        }
    }
    return nil
}

But when I run, all the data was 0s.

UIPicker set value based on description

$
0
0

I'm building a UIPickerView very similar to what we have in the post 3 Component Dynamic Multi UIPickerView Swift.

My code is

Class Country

import UIKit

class Country { 
var name: String 
var cities: [City]

init(name:String, cities:[City]) {
    self.name = name
    self.cities = cities
}
}

Class City

    import UIKit

class City { 
   var name: String 

init(name:String) {
    self.name = name
}
}

ViewController

class ViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource {

@IBOutlet weak var pickerView: UIPickerView!
@IBOutlet weak var countryLbl: UILabel!

var countries = [Country]()
var newOrExisting = "New"

override func viewDidLoad() {

    pickerView.delegate = self
    pickerView.dataSource = self

    countries.append(Country(name: "UK", cities: [City(name: "London"),City(name: "Manchester"), City(name: "Bristol")]))
    countries.append(Country(name: "USA", cities: [City(name: "New York"),City(name: "Chicago")]))
    countries.append(Country(name: "China", cities: [City(name: "Beijing"),City(name: "Shanghai"), City(name: "Shenzhen"), City(name: "Hong Kong")]))

    super.viewDidLoad()
    if newOrExisting == "Existing" {
    // here I need to load existing Country and City to the UIPickerView (for example, USA and Chigado) based on their names
    // newOrExisting status is updated in another ViewController. For example, let's assume it came as "existing"
    }


}

func numberOfComponents(in pickerView: UIPickerView) -> Int {
    return 2
}

func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {

    if component == 0 {
        return countries.count
    } else  {
        let selectedCountry = pickerView.selectedRow(inComponent: 0)
        return countries[selectedCountry].cities.count
    } 
}

func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
    if component == 0 {
        return countries[row].name
    } else {
        let selectedCountry = pickerView.selectedRow(inComponent: 0)
        return countries[selectedCountry].cities[row].name
    } 
}

func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
    pickerView.reloadAllComponents

    let selectedCountry = pickerView.selectedRow(inComponent: 0)
    let selectedCity = pickerView.selectedRow(inComponent: 1)
    let cityR = countries[selectedCountry].cities[selectedCity].name

    countryLbl.text = "The right answer was: \(selectedCountry) in \(cityR)"

}
}

Note: I haven't added my comments there because, as I have less than 50 reputations, I cannot comment.

With the above code, I can add data to my UIPickerView and read data from it. I then store that data to a Firebase database. There I'll have, for example, Country name "USA" and the City name "Chicago".

But, I now need to do the opposite path. If I read "USA" and "Chicago" from the database, how do I select those in the UIPickerView just using their names? I don't have the indexes in my database. Is there a way to do it?

Thanks

UiPickerView with custom fixed label and autolayout

$
0
0

I need to implement a UIPickerView to choose hours, minutes and seconds. I need to have a label, next to each component that stay fixed when the picker spin. For example you can look at the timer section of the Apple Clock app. I put an image for reference

enter image description here

of course I need a picker with 3 components but the problem is the same. I found a lot of solution to add a label as a subview and position it using some frames and manual adjustment but a can' t make it work with AutoLayout and i don' t find a solution on the web. Anyone has solved this problem? thanks

Viewing all 593 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>