Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8108297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:04:08+00:00 2026-06-06T01:04:08+00:00

I have a strange problem with integrating a ViewController into another ViewController . i

  • 0

I have a strange problem with integrating a ViewController into another ViewController .
i will explain my problem ,

I Have a ParentViewController ( the one who contains Buttons ( Ville/Autour De Moi , Carte/Liste … ) , and into this ParentViewController i switch between two ChildViewControllers : ListViewController and a MapViewController ( the one who contains the map ) , and i’ve specified the frame for the ChildViewControllers to take ( 0, 104, 320, 282) :

if(mapViewController ==nil) {
            mapViewController = [[MapViewController alloc] init];
            mapViewController.networkViewController = self;
        }

        mapViewController.view.frame = CGRectMake( 0, 104, 320, 282);
        [self.view addSubview:mapViewController.view];

everything is working like a charm , but the problem that i have is when i drag the map , my markers ans my Annotations are become Above the ParentViewController, and they hides buttons .

the images will explain my problem :

Before the Drag :

Before Dragging on the map

After the Drag on the Map :

after the drag on the map , my markers and annontations hides the view on the ParentViewController

NB : my ParentController doesn’t have a transparent background , and the map too , and i am using Mappy SDK IOS

The Code for adding Annotations : MPPoiDataSourceMappyCustom.m

#import "MPPoiDataSourceMappyCustom.h"

@implementation MPPoiDataSourceMappyCustom

-(UIView *) labelAtIndex:(NSIndexPath *)indexPath withScreeLocation:(CGPoint)screenLocation withViewBounds:(CGRect)_bounds update:(BOOL)aUpdate {

    // the label is allways up to date, we will not refresh it
    if (aUpdate)
        return nil;

    if ([elementList count] > indexPath.row)
    {
        MPPoi * mpoi = [elementList objectAtIndex:indexPath.row];
        MPGlobalStyle* style = [MPGlobalStyle sharedStyle];
        style.textColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0];
        //style.borderColor = [UIColor whiteColor];
        style.textFont = [UIFont fontWithName:@"Helvetica-Bold" size:12.0];
        style.borderColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0];
        //style.borderColor = [UIColor colorWithRed:0.32 green:0.87 blue:0.05 alpha:1.0];
        style.backgroundColor = [UIColor colorWithRed:0.627 green:0.066 blue:0.196 alpha:1.0];
        MPCalloutView* mpCallOutView = [MPCalloutView calloutWithText:mpoi.uId withScreeLocation:screenLocation withViewBoundsWidth:_bounds.size.width];

//        MPCalloutViewStyle* style = [MPCalloutViewStyle blackAndWhiteStyle];
        mpCallOutView.popinstyle = style;


        return mpCallOutView;
    }
    return nil;
}

@end

and this is the method that i use to show markers :

-(void) addMarkersOnMap {
    MPMarkerManager * markerManager = [self.mapView markerManager];
    MPMarkerCategory * category = [markerManager getCategory:STORE_LOC_CATEGORY];

    //change the image of markers of this category
    category.markerImage = [UIImage imageNamed:@"green-marker.png"];

    //category settings 
    [category setOptimalZoom:YES];//set the zoom to be optimal : show all poi in the category
    [category setHideLabelOnTheFirstShow:YES];
    [category setAnimateAtFirstShow:YES];

    //remove old elements   
    [category.dataSource removeAllElements];

    //create new mappy data source for our cotegory ( stores)
    MPPoiDataSourceMappyCustom* datasource = [[MPPoiDataSourceMappyCustom alloc] init ];

    //add markers on map
    for(int i=0; i<self.arrayStores.count; i++) {

        NSDictionary* currentStore = [self.arrayStores objectAtIndex:i];
        float latitude  = [[currentStore objectForKey:@"latitude"] floatValue];
        float longitude = [[currentStore objectForKey:@"longitude"] floatValue];
        CLLocationCoordinate2D locationStore = CLLocationCoordinate2DMake(latitude, longitude);

        //add the marker on the map for the current store
        //create a new POI object with location 
        NSString* str = [NSString stringWithFormat:@"%@ \n %@ %d", [currentStore objectForKey:@"title"],[currentStore objectForKey:@"address"], [currentStore objectForKey:@"CP"] ];
        MPPoi * poi = [[MPPoi alloc] initWithUId:str withLocation:locationStore];
        [datasource addElement:poi];
        [poi release];
        NSLog(@"add store %d on the map , coordonnées :( %f , %f )", i,latitude,longitude);
    }

    [category setDataSource:datasource];
    [datasource release];

    //send all subviews to the back
    for( UIView* view in [self.view subviews]) {
        [self.view sendSubviewToBack:view];
    }

}

Any ideas friends about the source of this strange problem ??? is this came from the Mappy SDK ? i’ve tried to boocle on the subviews of the MapViewController and send them to Back but it didn’t works for me .
thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:04:09+00:00Added an answer on June 6, 2026 at 1:04 am

    I’ve fixed it by trying to bring other views to the front :

    [self.view bringSubviewToFront:self.headerView];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange problem with Facebook Connect on one of my sites. It
I have strange problem... My file strings.xml contains: <?xml version=1.0 encoding=utf-8?> <resources> <string name=building_name>My
We have very strange problem, one of our applications is continually querying server by
i have strange problem doing reporting: i have numerous clients with different issued invoices.
I have strange problem with receiving data from socket. On client im using air
I have a strange problem on ipv6 connection. I write down a simple client
I have a strange problem with IE. I have a sequence of forms on
I have a strange problem with in-app billing RESTORE_TRANSACTION command. Every request RESTORE_TRANSACTION request
I have a strange problem getting the color of the point that was touched.
I have very strange problem while I am submitting a practice problem on codechef.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.