Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picker rows disappear when scrolling #167

Open
vendulasvastal opened this issue Sep 20, 2019 · 3 comments
Open

Picker rows disappear when scrolling #167

vendulasvastal opened this issue Sep 20, 2019 · 3 comments

Comments

@vendulasvastal
Copy link

vendulasvastal commented Sep 20, 2019

When I try to scroll through my picker which is positioned under the title all the rows disappear. I have searched for this issue and I have found (not here) that the issue is connected with the view that contains the picker.

Are there any solutions?

my code:

import BLTNBoard

class PickerBLTNItem<T: Pickable>: BLTNPageItem, UIPickerViewDataSource, UIPickerViewDelegate {
    lazy var picker: UIPickerView = UIPickerView()
    var items: [T]
    
    init(items: [T]) {
        self.items = items
        super.init(title: T.description)
        setup()
    }
    
    func setup() {
        image = T.image
        actionButtonTitle = Localized.General.done
        picker.delegate = self
        picker.dataSource = self
    }
    
    override func makeViewsUnderImage(with interfaceBuilder: BLTNInterfaceBuilder) -> [UIView]? {
        return [picker]
    }
    
    func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
        return items[row].description
    }

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

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

first I have tried implementing a picker with custom rows and I thought that the customization might cause this problem but even the simplest picker implementation doesn't work and causes the same issue.

@omarmhaimdat
Copy link

same problem

@omarmhaimdat
Copy link

My problem came from dark mode in iOS 13

@vendulasvastal
Copy link
Author

I am implementing an app supporting iOS 11 and higher and have not tried dark mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants