[英]What can I do to prevent iPhone 4 from cutting off my title when adding to home screen?
I have long web page title and when adding to home screen in iPhone older versions the whole title is visible in the confirmation dialog. 我有很长的网页标题,当在iPhone旧版本中添加到主屏幕时,整个标题在确认对话框中可见。 When I add to home screen in iPhone 4 the title is cut off after the 12th symbol.
当我在iPhone 4中添加到主屏幕时,标题在第12个符号后被切断。 Is there a way to stop this cutting so iPhone is showing the full title by default?
有没有办法阻止这种切割,所以iPhone默认显示完整的标题?
Apparently there will be a undocumented meta tag 显然会有一个未记录的元标记
<meta name="apple-mobile-web-app-title" content="Title"
><meta name="apple-mobile-web-app-title" content="Title"
>
in iOS 6 to solve that issue. 在iOS 6中解决该问题。
No, there is no way to prevent that. 不,没有办法阻止这一点。 Application names on the home screen are limited to a maximum of 12 characters.
主屏幕上的应用程序名称限制为最多12个字符。 Anything beyond that will be truncated by placing an ellipsis in the middle of the name.
除此之外的任何内容都会通过在名称中间放置省略号来截断。
You will need to keep the title of your website under 13 characters on the iPhone if you want to prevent it from being cut off. 您将需要保持你的网站的标题下在iPhone上13个字符,如果你想阻止它被切断。 See the other answers for possible ways of doing that.
请参阅其他答案,了解可能的方法。
Update: As of iOS 6, you can use a meta tag to set the name of your application as displayed on the home screen. 更新:从iOS 6开始,您可以使用元标记设置主屏幕上显示的应用程序名称。 Full details and instructions are available here .
有关详细信息和说明,请点击此处 。
Use a short Page Title with this code: 使用以下代码的简短页面标题:
<script type="text/javascript">
if( navigator.userAgent.match(/iPhone/i) ||
navigator.userAgent.match(/iPod/i) ||
navigator.userAgent.match(/iPad/i)
) {
document.title = "Short title";
}
</script>
But you cannot use the full title. 但你不能使用完整的标题。
You can change the title for iOS devices as woodleader has answered but this will change it in normal mobile safari. 您可以在woodleader已经回答的情况下更改iOS设备的标题,但这会在正常的移动版游戏中更改它。 Only the user can change the title of the webapp.
只有用户才能更改webapp的标题。 It's not possible to do it with meta tags or programmatically.
使用元标记或以编程方式执行此操作是不可能的。 So you just need to choose a shorter title or leave it up to the user, who will likely change it, if it is too long.
因此,您只需要选择较短的标题,或者将其留给用户,如果用户太久,可能会更改标题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.