2013-02-18 82 views

回答

0

@JP ...感謝您的答案。在此期間,我找到了一個辦法。

我將分段控制器作爲疊加層放置在地圖上,以改變地圖的樣式(標準/衛星/混合),如同谷歌地圖。請注意背景顏色的微妙變化 - 這是爲了提高標準樣式地圖的可讀性,標準樣式地圖比基於衛星的圖像具有更輕的背景。

- (void) setMapSelectorColors:(UISegmentedControl *)control { 
    NSDictionary *mapStyleSelectorTextAttributes = [NSDictionary dictionaryWithObject:[UIColor blackColor] forKey:UITextAttributeTextColor]; 

    [self.mapStyleSelector setTitleTextAttributes:mapStyleSelectorTextAttributes forState:UIControlStateNormal]; 

    if (control.selectedSegmentIndex == 0) { 
     self.mapStyleSelector.tintColor = [UIColor lightGrayColor]; 
    } else { 
     self.mapStyleSelector.tintColor = [UIColor whiteColor]; 
    } 
} 
相關問題