2016-04-01 7 views
0

マップビューのコールアウトボタンに画像の代わりにテキストを表示することはできますか?ピン注釈のコールアウトボタンのテキスト

これは何か?

let leftCalloutButton = UIButton(type: .Custom) 
leftCalloutButton.text = "jobs" // this line doesn't compile 
pinView!.leftCalloutAccessoryView = leftCalloutButton 

setTitleの実装をいくつか試してみましたが、成功しませんでした。助言がありますか?

答えて

1

UIButtonは、タイトルを設定するための独自の方法を有する:

leftCalloutButton.setTitle("myTitle", forState: UIControlState.Normal) 
+0

I最終的に、私はまた、フレームが必要実現のでleftCalloutButton.frame = CGRectMake(0,0,40,40)。 – Shane