在我的应用程序中,我使用的是 Google Maps SDK。
我的应用程序中有一个全屏 map 。
问题是 Google Logo 在导航选项卡后面的屏幕底部被截断。
我不知道要改变什么来调整 map 大小以在屏幕上显示 Logo 。
我会附上问题的截图,但我没有足够的声誉。
由于我是 Obj-C 和 Xcode 编程的新手,我可能忘记发布 map 实现所必需的部分代码。
- (void)viewDidLoad
{
[super viewDidLoad];
_firstLocationUpdate = NO;
_errorView.layer.cornerRadius = 5;
_errorView.clipsToBounds = YES;
GMSCameraPosition *camera = [GMSCameraPosition cameraWithTarget:_mapView.myLocation.coordinate zoom:14];
_mapView = [GMSMapView mapWithFrame:self.view.frame camera:camera];
_mapView.delegate = self;
[self.view addSubview:_mapView];
[self.view sendSubviewToBack:_mapView];
}
我设法把它强了一点,但这真的很丑陋。
_mapView = [GMSMapView
mapWithFrame: CGRectMake(
0, -50,
self.view.frame.size.width, self.view.frame.size.height)
camera: camera];
[self.view addSubview:_mapView];
[self.view sendSubviewToBack:_mapView];
Best Answer-推荐答案 strong>
另一种选择是在保持 View 大小相同的同时填充控件:
// top, left, bottom, right
_mapView.padding = UIEdgeInsetsMake(0.0, 0.0, 50.0, 0.0);
使用 SDK 1.8 进行测试,它会移动 Google Logo 和各种控件。
Google SDK documentation for the padding property :
Controls the 'visible' region of the view.
By applying padding an area arround the edge of the view can be created which will contain map data but will not contain UI controls.
If the padding is not balanced, the visual center of the view will move as appropriate. Padding will also affect the projection property so the visible region will not include the padding area. GMSCameraUpdate fitToBounds will ensure that both this padding and any padding requested will be taken into account.
This property may be animated within a UIView-based animation block.
关于ios - 谷歌 Logo 隐藏在底部任务栏后面,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/23905246/
|