0
我正在實現一個基於MKMapView的應用程序。在這我使用自定義圖像,而不是使用MKAnnotationView.Image屬性顯示一個別針。它工作正常。但是我在海洋中顯示的針腳顯示有問題。當我使用默認引腳時,它工作正常。我不知道是什麼問題。你們可以請這個建議我嗎?請幫幫我。MKAnnotation圖像屬性的問題
cityAnnotationView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"CityAnnotation"] autorelease];
//cityAnnotationView.image = [[UIImage imageNamed:@"city_pin.png"] stretchableImageWithLeftCapWidth:100 topCapHeight:10];
cityAnnotationView.image = [UIImage imageNamed:@"city_pin.png"];
cityAnnotationView.backgroundColor=[UIColor clearColor];
cityAnnotationView.annotation = annotation;
cityAnnotationView.canShowCallout = NO;
cityAnnotationView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
在此先感謝。 Sekhar。
可以PLZ張貼一些代碼,這樣我可以幫助ü解決這個問題... – 2010-10-29 12:10:59
cityAnnotationView = [[[MKAnnotationView頁頭] initWithAnnotation:註釋reuseIdentifier:@「CityAnnotation」] autorelease]; \t \t \t \t //cityAnnotationView.image = [[UIImage imageNamed:@「city_pin.png」] stretchableImageWithLeftCapWidth:100 topCapHeight:10]; \t \t \t \t cityAnnotationView.image = [UIImage imageNamed:@「city_pin.png」]; \t \t \t \t cityAnnotationView.backgroundColor = [UIColor clearColor]; \t \t \t \t cityAnnotationView.annotation = annotation; \t \t \t \t cityAnnotationView.canShowCallout = NO; \t \t \t \t cityAnnotationView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; – sekhar 2010-10-29 12:16:18
這是註解視圖的代碼。顯示創建註釋的代碼,包括如何設置座標。 – Anna 2010-10-29 13:01:53