MKMapView默认注释标题和副标题的长度限制
尝试弄清楚 MKMapView 的标准注释视图中可以显示的字符数是否存在硬性限制。我不想自定义此视图,而且我也不希望省略号 (...) 显示在我的标题和副标题中。
标题和副标题的字符串长度限制是多少?
或者,如果没有“硬”限制,
我如何计算我的字符串是否会在后面加上省略号(...)?
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 (...)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为下面的屏幕截图最能说明地图视图上有多少空间:
分辨率似乎宽度是限制你的因素。
标题:32 个字符*
副标题:48 个字符*
** 在三个点出现之前。*
(我必须承认我创建了一个小助手
来完成此操作。这可能就是为什么没有省略号覆盖这些点)。华泰
I think following screenshot demonstrates best how much space there is on the mapview:
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