gpt4 book ai didi

iPhone : Top Navigation bar push the Google logo down the screen

转载 作者:行者123 更新时间:2023-12-03 19:22:08 25 4
gpt4 key购买 nike

I am new to iPhone development, please suggest the right way to rectify the below problem.

I am displaying the Google Map as below :

enter image description here

Now the problem is the Top Navigation bar pushes the Google logo on Map below screen and hence it is not visible, when I hide the Navigation bar, I can see the Google logo as below

enter image description here

Code Reference :

- (void)viewDidLoad
{
[super viewDidLoad];

[self.navigationController setNavigationBarHidden:YES animated:NO];

mapView.showsUserLocation=TRUE;
self.title =@"Map View";
mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];
mapView.showsUserLocation=TRUE;
mapView.mapType = MKMapTypeStandard;
mapView.delegate=self;




/*Region and Zoom*/
MKCoordinateRegion region;
MKCoordinateSpan span;
span.latitudeDelta = 0.2;
span.longitudeDelta = 0.2;

CLLocationCoordinate2D location=mapView.userLocation.coordinate;
AppDelegate *appdelegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];

location.latitude = [appdelegate.RDLat doubleValue];
location.longitude = [appdelegate.RDLng doubleValue];

region.span=span;
region.center=location;


[mapView setRegion:region animated:TRUE];
[mapView regionThatFits:region];


ParkPlaceMark *placemark=[[ParkPlaceMark alloc] initWithCoordinate:location title:appdelegate.RestAddress];
[mapView addAnnotation:placemark];

[self.view insertSubview:mapView atIndex:0];

}

Now Please suggest me how to show Navigation bar without pushing the Google map below.

Any help highly appriciated

最佳答案

只需更改以下行

mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];

mapView = [[MKMapView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x,44,self.view.frame.size.width,self.view.frame.size.height-44)];

它会发挥魅力。如果不是请告诉我。

关于iPhone : Top Navigation bar push the Google logo down the screen,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6517561/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com