Pre*_*eek 10 uiview ios uistoryboard google-maps-sdk-ios
我在我的项目中使用GoogleMaps Pod.我的故事板中有错误:
错误:IB Designables:无法呈现和更新MapViewController的自动布局状态:dlopen(GoogleMaps.framework,1):找不到合适的图像.找到了:GoogleMaps.framework:mach-o,但文件类型错误
我已将视图类设置为GMSMapView:
应用程序正在模拟器上工作.我该如何解决这个错误?它导致整个故事板为空白.
小智 5
创建 GMSMapView 的子类并使用该类名而不是 GMSMapView。添加此错误后不会发生并且整个故事板都在工作。
import GoogleMaps
class GoogleMapView : GMSMapView {
}
Run Code Online (Sandbox Code Playgroud)
通过在模拟器中编写代码手动使用GMSMapView;而不是GMSMapView在故事板中使用。
如果您在多个屏幕中使用地图。然后为所有文件手动编写代码。
@IBOutlet weak var map_Views: UIView!
var map_View = GMSMapView()
override func viewDidLoad() {
super.viewDidLoad()
let camera = GMSCameraPosition.camera(withLatitude: Double(main_latitude)!, longitude: Double(main_longitude)!, zoom: 6.0)
map_View = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
map_Views = map_View
map_View.camera = GMSCameraPosition.camera(withLatitude:Double(main_latitude)!,
longitude:Double(main_longitude)!,
zoom:10.0,
bearing: 0,
viewingAngle: 0)
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1159 次 |
| 最近记录: |