How can I hide those 2 lines on the selected row?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
This is easily achieved. Just place your PickerView inside a ScrollView with the desired size of your row, and use the picker delegate(pickerView:rowHeightForComponent:) method to change the the row height of the picker to a little bigger than your ScrollView. Like that, the lines will be hidden.
I solved this by a simple trick: Place picker view in a view, and set clip subviews property of this view = true. Now, just set height of row in picker view = height of container view then the line will disappear.
I opted for a different approach to make it a bit more future proof just in case Apple decide to change something down the line
since the (subView that contains the items)'s origin y location is 0 then I can safely hide anything else without risking an index out of bounds error
Enjoy
EDIT: I forgot to tell you that I put it in the viewDidLayoutSubviews method!