如何在google maps for ios上将mylocation按钮设置为右上角

如何在google maps for ios上将mylocation按钮设置为右上角,ios,iphone,ipad,google-maps,Ios,Iphone,Ipad,Google Maps,我用以下代码在viewcontroller中实现了google地图: self.mapView.settings.myLocationButton = YES; mapView.myLocationEnabled = YES; mapView.mapType = kGMSTypeNormal; mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.

我用以下代码在viewcontroller中实现了google地图:

self.mapView.settings.myLocationButton = YES;
mapView.myLocationEnabled = YES;

mapView.mapType = kGMSTypeNormal;
mapView.autoresizingMask =
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

self.view = [[UIView alloc] initWithFrame:CGRectZero];
[self.view addSubview:mapView];
我还想在地图视图的最底部位置添加另一个子视图,但它不会显示:

UIView *holder = [[UIView alloc] initWithFrame:CGRectMake(320, 568, 0, 120)];
holder.autoresizingMask =
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
holder.backgroundColor =
[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0];
[self.view addSubview:holder];

提前谢谢

我想你对
CGRectMake
有点困惑。第一个参数是x,第二个参数是y,第三个参数是宽度,最后一个参数是高度。那么,你的意思是什么

CGRectMake(320, 568, 0, 120)
是“在右下角做一个矩形,宽度为零,高度为120点”。
这有意义吗?或者你需要更多关于坐标的帮助吗?

我认为你在主视图之外创建支架视图,通过减少原点y,尝试在主视图维度中创建支架视图。假设CGRectMake(320400,0120)];我更新了UIView*holder=[[UIView alloc]initWithFrame:CGRectMake(0[UIScreen mainScreen].bounds.size.height-75,0,120)];谢谢你,艾琳。但是左下角的myLocationButton问题没有解决。我想把那个按钮放在右上角。可能吗?你接受了我的答案,所以我想你的问题现在解决了?