完善任务流程、键盘适配与页面交互
This commit is contained in:
@ -13,12 +13,14 @@ final class LocationReportMapControlStack: UIView {
|
||||
var onZoomIn: (() -> Void)?
|
||||
var onZoomOut: (() -> Void)?
|
||||
var onRelocate: (() -> Void)?
|
||||
private weak var relocateButton: UIButton?
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
let zoomIn = makeButton(symbol: "plus", action: #selector(zoomInTapped))
|
||||
let zoomOut = makeButton(symbol: "minus", action: #selector(zoomOutTapped))
|
||||
let relocate = makeButton(symbol: "location.fill", action: #selector(relocateTapped))
|
||||
relocateButton = relocate
|
||||
|
||||
let zoomStack = UIStackView(arrangedSubviews: [zoomIn, zoomOut])
|
||||
zoomStack.axis = .vertical
|
||||
@ -44,6 +46,12 @@ final class LocationReportMapControlStack: UIView {
|
||||
}
|
||||
}
|
||||
|
||||
/// 更新定位按钮是否可用。
|
||||
func setRelocateEnabled(_ isEnabled: Bool) {
|
||||
relocateButton?.isEnabled = isEnabled
|
||||
relocateButton?.alpha = isEnabled ? 1 : 0.46
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
|
||||
Reference in New Issue
Block a user