mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
Dropdown picker more user-friendly
This commit is contained in:
parent
b55aa86ba4
commit
5040e6dae9
2 changed files with 6 additions and 2 deletions
|
|
@ -12,6 +12,7 @@ job-ios:
|
|||
script:
|
||||
- pod install --repo-update
|
||||
- pwd
|
||||
- sed 's/fileprivate let tableView =/public let tableView =/g' ./Pods/DropDown/DropDown/src/DropDown.swift > tmp.swift && mv -f tmp.swift ./Pods/DropDown/DropDown/src/DropDown.swift
|
||||
- xcodebuild archive -scheme $archive_scheme -archivePath ./$archive_path -configuration Release -workspace ./linphone.xcworkspace -UseModernBuildSystem=YES -destination 'generic/platform=iOS'
|
||||
- xcodebuild -exportArchive -archivePath ./$archive_path -exportPath ./$export_path -exportOptionsPlist ./$export_options_plist -allowProvisioningUpdates -UseModernBuildSystem=YES -destination 'generic/platform=iOS'
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class StyledValuePicker: UIView {
|
|||
// layout constants
|
||||
let chevron_margin = 10.0
|
||||
let form_input_height = 38.0
|
||||
let dropdown_width = 250.0
|
||||
let dropDown = DropDown()
|
||||
|
||||
|
||||
|
|
@ -73,16 +74,18 @@ class StyledValuePicker: UIView {
|
|||
dropDown.bottomOffset = CGPoint(x: 0, y:(dropDown.anchorView?.plainView.bounds.height)!)
|
||||
dropDown.dataSource = options
|
||||
dropDown.backgroundColor = .white
|
||||
dropDown.width = dropdown_width
|
||||
|
||||
dropDown.selectionAction = { [unowned self] (index: Int, item: String) in
|
||||
liveIndex.value = index
|
||||
dropDown.selectRow(at: index)
|
||||
//dropDown.tableView.scrollToRow(at: IndexPath(row: index, section: 0), at: .middle, animated: true)
|
||||
formattedLabel.text = " "+options[liveIndex.value!]
|
||||
dropDown.hide()
|
||||
}
|
||||
|
||||
onClick {
|
||||
self.dropDown.anchorView = self.superview
|
||||
self.dropDown.tableView.scrollToRow(at: IndexPath(row: liveIndex.value!, section: 0), at: .top, animated: true) // Change visibility to public instead of fileprivate in DropDown.swift
|
||||
self.dropDown.show()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue