Objective-C – UILocalNotification alertBody length

北城余情 提交于 2019-12-07 18:45:55

问题


I'm looking for some documentation to find the maximum length of the alertBody of a UILocalNotification before it will get clipped in either the notification center (banner) or in a popup alert.


回答1:


I haven't found any specific limit documented. However, you can try it out and see that the notification drop down shows about 80 characters. This is on an iPhone 5S with iOS 7.1.

The notification center shows more of the message. In this case about 138 characters before it starts truncating.

Of course with proportionally space fonts the number of characters depends on the width of those characters, the iPhone has less width to display text than the iPad, and future version of iOS may change this.




回答2:


Hmm it wasn't that easy. It also depends on the character widths. I suppose you just have to make room to support different character widths.



来源:https://stackoverflow.com/questions/11177611/objective-c-uilocalnotification-alertbody-length

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!