2012-06-18 2 views
0

ViewController을 다른 ViewController에 통합하는 데 이상한 문제가 있습니다. 난 내 문제를 설명합니다 ,ParentViewController에 childViewController를 추가 할 때의 문제

내가 가진 포함하는 ParentViewController (하나의 Buttons (/Autour 드 모이, 빌 르트/Liste ...),이 ParentViewController에 내가 두 ChildViewControllers 사이를 전환 : ListViewControllerMapViewController (지도를 포함하는 하나), 그리고 ChildViewControllers(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]; 

모든 매력처럼 작동하고,하지만 문제 내가 가지고있는 것은 맵을 드래그 할 때 내 마커가 내 주석이 ParentViewController 위에 있고, buttons을 숨기는 것입니다.

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

NB : 내 ParentController 아무튼지도를 드래그 한 후

Before Dragging on the map

: 드래그하기 전에

:

이미지가 내 문제를 설명합니다 투명한 배경을 가지고 있지 않다. 그는 너무지도, 그리고 난 추가 주석에 대한 Mappy SDK IOS

코드를 사용하고 있습니다 : 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 

를이 내가 마커를 표시하기 위해 사용하는 방법입니다 :

-(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]; 
    } 

} 

이 이상한 문제의 근원에 관한 아이디어 친구들 ??? 이것이 Mappy SDK에서 온 것입니까? 나는 MapViewController의 하위 뷰를 부풀려서 Back에 보냈지 만 나에게 도움이되지 못했습니다. ...

[self.view bringSubviewToFront:self.headerView]; 
+0

어떤 도움 ?? : – Houcine

답변

0

사전

에서 덕분에 나는 앞으로 다른 의견을 가지고 노력하여 해결 한?
관련 문제