2011-07-01 24 views

回答

4

嘗試使用以下映射視圖的委託方法。您可以設置正確的判罰了附件視圖按鈕

- (MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id <MKAnnotation>)annotation{ 

MKAnnotationView *view = nil; 
//MKPinAnnotationView *view=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"HotSpotsLoc"]; 

if(annotation !=mapView.userLocation){ 
    view = (MKAnnotationView *) 
    [mapView dequeueReusableAnnotationViewWithIdentifier:@"identifier"]; 
    if(nil == view) { 
     view = [[[MKAnnotationView alloc] 
       initWithAnnotation:annotation reuseIdentifier:@"identifier"] 
       autorelease];   
    } 


    ParkPlaceMark *currPlaceMark = annotation; 
    NSLog(@"%i",currPlaceMark.position); 

     view.image = [UIImage imageNamed:@"pin.png"]; 

    UIButton *btnViewVenue = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; 
    view.rightCalloutAccessoryView=btnViewVenue; 
    view.enabled = YES; 
    view.canShowCallout = YES; 
    view.multipleTouchEnabled = NO; 
    //view.animatesDrop = YES; 

}  
return view; 
} 
-1

編輯:無視這個答案。你的完整問題沒有被顯示,因爲壞標記,我推斷(不正確)你的問題是什麼。


您可以從右側的對象選項板拖動任何東西到想要的UITableViewCell上。

但是,如果要將其作爲accessoryView添加,請執行而不是。 將其作爲單獨的頂級對象添加到接口文件中,並將單元格的出口處的連接拖至所需的視圖/按鈕。

+0

你總是可以刪除一個答案... – fabian789

+0

謝謝,我會在接受我對該問題的編輯之後 - 這樣其他人就會知道存在問題 – bshirley

相關問題