简体   繁体   English

添加到主屏幕后,我该怎么做才能阻止iPhone 4切断我的标题?

[英]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.

相关问题 当 iPhone 用户退出主屏幕或 App Switcher 时,如何让我的计时器继续运行? - How can I make my timer keep running when the iPhone user quits to the home screen or the App Switcher? 添加到主屏幕时,iPhone Webapp中断 - iPhone webapp breaks when adding to home screen 是否可以在不更改应用程序名称的情况下更改iPhone主屏幕上的图标标题? - Can I change the icon title on the iPhone home screen without changing the application name? 从我的应用程序锁定 iPhone 主屏幕 - Lock iphone home screen from my app 在网站上添加特定页面的书签,而不考虑添加到主屏幕时iPhone上的哪个页面? - Bookmark certain page on site regardless of what page your on for iPhone when adding to home screen? 当用户单击“添加到主屏幕”时,是否可以向iPhone定位的Web应用程序添加其他内容? - Can I add additional content to my iPhone-targeted web app when the user clicks on “add to home screen”? 如何防止iPhone OS关闭屏幕或进入待机状态? - How can I prevent that iPhone OS switches off the screen or goes into standby? 如何让 iPhone 4 手电筒应用程序在关闭时不闪烁? - How do I keep my iPhone 4 flashlight app from blinking when it turns off? 我的旧iPhone能怎样做? - What can I do with my old iPhone iPhone视图中断 - iPhone View Cutting Off
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM