UIPickerView in UITableView doesn't react to touch in lower half of cell

人走茶凉 提交于 2019-12-11 19:15:35

问题


I have a UITableView with one cell only (I will need more later) that contains just a UIPickerView. The single component in the UIPickerView will only scroll when I begin touching it in the top half of the UIPickerView. It will not move at all if my touch starts in the lower half.

I have set the following properties in interface builder for the UITableView:

  • No selection
  • Scrolling disabled
  • Bounces: NO
  • Bounces Zoom: NO
  • Delays Content Touches: NO
  • Cancellable Content Touches: NO

How can I allow touches to scroll the UIPicker from anywhere in the component?


回答1:


Have faced this issue many times now and it happens usually due to one of the 2 reasons

  1. There is a view on top of the picker's bottom half (try moving the picker to the front in view hierarchy)

  2. The content size of the parent view is not large enough to cover the entire picker. So only the part of the picker present inside this area is handling touches



来源:https://stackoverflow.com/questions/13612122/uipickerview-in-uitableview-doesnt-react-to-touch-in-lower-half-of-cell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!