How to set the frame for mapview - in google GMSMap for iOS6

后端 未结 5 1432
青春惊慌失措
青春惊慌失措 2020-12-11 07:47

I am trying to load places inside Google Map View for iOS6. How to set the frame for the Map ? Currently it is fullscreen

 -(void)loadView {

   GMSCameraPos         


        
5条回答
  •  南方客
    南方客 (楼主)
    2020-12-11 08:21

    You need to do like this

     -(void)loadView {
    
        GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:10.00989
                                                            longitude:76.316142
                                                                 zoom:15];
    
        mapView_ = [GMSMapView mapWithFrame:self.newView.bounds camera:camera];
    
        [self.view addSubview:newView];
    
        [self.newView addSubview:mapView_];
    }
    

提交回复
热议问题