alexaubry / alexaubry/BulletinBoard

Picker rows disappear when scrolling

Đang mở
#167 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Swift
Star
5.3k
Fork
301
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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: 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.