谷歌地图图钉第一次没有显示

时间:2011-12-06 13:15:54

标签: iphone objective-c xcode

我正在使用以下代码来显示Google地图中当前位置的图钉。但是当我点击按钮显示图钉时,第一次图钉没有显示但是当我第二次点击它时会显示图钉。 请建议我替代:

     UIButton *myDetailButton = [UIButton buttonWithType:UIButtonTypeCustom];
    //UIButton *myDetailButton = [UIButton buttonWithType:UITableViewCellAccessoryDetailDisclosureButton];
    myDetailButton.frame = CGRectMake(0, 0, 23, 23);
    myDetailButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
    myDetailButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    myDetailButton.tag = tag;
    tag++;
    //[myDetailButton addTarget:self action:@selector(gotoBusinessDetail:) forControlEvents:UIControlEventTouchUpInside];

    // Set the button as the callout view
    currentMarkerAnnotationView.rightCalloutAccessoryView = myDetailButton;


    currentMarkerAnnotationView.image = [UIImage imageNamed:@"redmarker.png"];
    currentMarkerAnnotationView.canShowCallout = NO;        

    return currentMarkerAnnotationView;

0 个答案:

没有答案