Skip to content

Commit 9d5dee5

Browse files
committed
fix: Odd movement of the Apple logo
1 parent 5bc0f0b commit 9d5dee5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ios/Classes/MapView/AppleMapController.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Foundation
99
import MapKit
1010

1111
public class AppleMapController: NSObject, FlutterPlatformView {
12+
var contentView: UIView
1213
var mapView: FlutterMapView
1314
var registrar: FlutterPluginRegistrar
1415
var channel: FlutterMethodChannel
@@ -25,6 +26,11 @@ public class AppleMapController: NSObject, FlutterPlatformView {
2526
self.mapView = FlutterMapView(channel: channel, options: options)
2627
self.registrar = registrar
2728

29+
// To stop the odd movement of the Apple logo.
30+
self.contentView = UIScrollView()
31+
self.contentView.addSubview(mapView)
32+
mapView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
33+
2834
self.initialCameraPosition = args["initialCameraPosition"]! as! Dictionary<String, Any>
2935

3036
super.init()
@@ -56,7 +62,7 @@ public class AppleMapController: NSObject, FlutterPlatformView {
5662
}
5763

5864
public func view() -> UIView {
59-
return mapView
65+
return contentView
6066
}
6167

6268
private func setMethodCallHandlers() {

0 commit comments

Comments
 (0)