开发者

Length limit of default annotation title and subtitle on MKMapView

开发者 https://www.devze.com 2023-04-01 03:35 出处:网络
Trying to figure out if there is a hard limit to the number of characters you can display in the standard annotation view for a MKMapView. I dont want to customize this view, and I also dont want the

Trying to figure out if there is a hard limit to the number of characters you can display in the standard annotation view for a MKMapView. I dont want to customize this view, and I also dont want the ellipses (...) to show up in my title and subtitle.

What is the limit to the length of a string for both the title and subtitle?

or, if there is no 'hard' limit,

How can I calculate whether or not my string will be post-pended with an ellipses (.开发者_C百科..)?


I think following screenshot demonstrates best how much space there is on the mapview:

Length limit of default annotation title and subtitle on MKMapView

It seems like the resolution width is what limits you there.

Title: 32 Characters*
Subtitle: 48 Characters*
** Before the three dots show up.*

(I have to admit that I created a small helper <MKAnnotation> to accomplish this. That might be why there are no ellipses covering up the dots).

HTH

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号