Note that there are some explanatory texts on larger screens.

plurals
  1. POTab bar and Mapview issues
    primarykey
    data
    text
    <p>I'm really confused about this issue. I have recently been having issues with my mapview tab in my application. Even to the point of starting over again. I'm just wondering if I am the only one having this issue or am I doing something wrong here. </p> <p>I am fairly new to iOS but I know how to define a mapview's center and span in order to center on the user's location. </p> <p>I've built this in its own view and it seems to work but when I put it in a tab controller...I have an issue. The map stays zoomed out while showing the user's location. It's supposed to show the user's location zoomed in.</p> <p>My MapViewController:</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; [self.mapView.delegate self]; [self.mapView setShowsUserLocation:YES]; // Do any additional setup after loading the view from its nib. } -(void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation { CLLocationCoordinate2D loc = [userLocation coordinate]; MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(loc, 500, 500); [self.mapView setRegion:region animated:YES]; } </code></pre> <p>I also thought it could have something to do with the way I created the tab controller in the delegate.</p> <p>My app delegate:</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. UIViewController *viewController1 = [[NWSWelcomeViewController alloc] initWithNibName:@"NWSWelcomeViewController" bundle:nil]; UIViewController *viewController2 = [[NWSMapViewViewController alloc] initWithNibName:@"NWSMapViewViewController" bundle:nil]; // UIViewController *viewController3 = [[NWSSettingsViewController alloc] initWithNibName:@"NWSSettingsViewController" bundle:nil]; self.tabBarController = [[UITabBarController alloc] init]; self.tabBarController.viewControllers = @[viewController1, viewController2, /* viewController3 */]; self.window.rootViewController = self.tabBarController; [self.window makeKeyAndVisible]; return YES; } </code></pre> <p>I am writing for iOS 5.1 and I am using the latest Xcode. </p> <p>Yes, I have the settings for zooming enabled on the mapView. </p> <p>I just want to get the user location to zoom in the mapview to the user's location. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload