alexaubry / alexaubry/BulletinBoard

Picker rows disappear when scrolling

未關閉
#167 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Swift
星號
5.3k
分支
301
PR 合併指標
30 天內沒有已合併 PR

描述

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.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。