我正在使用带滑轮库的googleMaps,它非常适合显示bottomSheets https://github.com/52inc/Pulley。但是,我使用的是GoogleMaps,对于googlemaps,由Google *提供图像的显示归因必须始终存在于地图上,并且在使用地图时不得被任何视图覆盖。
当opened
时,如何使此显示属性正确显示在bottomDrawer的顶部,而当bottomDrawer关闭时,如何在我的MapViewController的底部正确显示。
extension HomeVC: PulleyPrimaryContentControllerDelegate {
func drawerPositionDidChange(drawer: PulleyViewController, bottomSafeArea: CGFloat) {
guard let drawer = drawer as? BottomSheetVC else { return }
switch drawer.drawerPosition {
case .closed:
if drawer.mode == .estimate {
self.toggleButton.image = Icon.arrowBack
}
case .collapsed:
if drawer.mode == .estimate {
self.toggleButton.image = Icon.close
}
default: break
}
}
func makeUIAdjustmentsForFullscreen(progress: CGFloat, bottomSafeArea: CGFloat) {
}
func drawerChangedDistanceFromBottom(drawer: PulleyViewController, distance: CGFloat,
bottomSafeArea: CGFloat) {
guard let drawer = drawer as? BottomSheetVC else { return }
let distance = distance - bottomSafeArea
if drawer.mode == .estimate {
mapView.padding = UIEdgeInsets(top: 20, left: 0, bottom: distance, right: 20)
} else {
mapView.padding = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
}
fabBottomConstraint.constant = distance + 16
}
}
这是我在不使用bottomDrawer的情况下显示图像的方式
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
if section == tableView.numberOfSections - 1 {
let footerView = UIView.init(frame: CGRect(x:0, y:0, width:tableView.frame.size.width, height:100))
footerView.backgroundColor = UIColor.clear
let imageView: UIImageView = UIImageView.init(frame: CGRect.init(x: 40, y: 0, width: footerView.bounds.size.width - 80, height: footerView.frame.size.height / 2))
imageView.image = R.image.powered_by_google_on_white()
imageView.contentMode = UIView.ContentMode.center
footerView.addSubview(imageView)
return footerView
} else {
return nil
}
}