添加到主屏幕后,如何防止iPhone 4切断标题?

时间:2022-11-11 22:54:10

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. When I add to home screen in iPhone 4 the title is cut off after the 12th symbol. Is there a way to stop this cutting so iPhone is showing the full title by default?

我有很长的网页标题,当在iPhone旧版本中添加到主屏幕时,整个标题在确认对话框中可见。当我在iPhone 4中添加到主屏幕时,标题在第12个符号后被切断。有没有办法阻止这种切割,所以iPhone默认显示完整的标题?

4 个解决方案

#1


11  

No, there is no way to prevent that. Application names on the home screen are limited to a maximum of 12 characters. Anything beyond that will be truncated by placing an ellipsis in the middle of the name.

不,没有办法阻止这一点。主屏幕上的应用程序名称限制为最多12个字符。超出此范围的任何内容都将通过在名称中间放置省略号来截断。

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. See the other answers for possible ways of doing that.

如果您想要防止它被切断,您需要在iPhone上保留13个字符以下的网站标题。请参阅其他答案,了解可能的方法。

Update: As of iOS 6, you can use a meta tag to set the name of your application as displayed on the home screen. Full details and instructions are available here.

更新:从iOS 6开始,您可以使用元标记设置主屏幕上显示的应用程序名称。这里有完整的详细信息和说明。

#2


22  

Apparently there will be a undocumented meta tag

显然会有一个未记录的元标记

<meta name="apple-mobile-web-app-title" content="Title">

in iOS 6 to solve that issue.

在iOS 6中解决该问题。

#3


10  

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.

但你不能使用完整的标题。

#4


0  

You can change the title for iOS devices as woodleader has answered but this will change it in normal mobile safari. Only the user can change the title of the 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.

您可以在woodleader已经回答的情况下更改iOS设备的标题,但这会在正常的移动版游戏中更改它。只有用户才能更改webapp的标题。使用元标记或以编程方式执行此操作是不可能的。因此,您只需选择较短的标题或将其留给用户,如果时间过长,可能会更改标题。

#1


11  

No, there is no way to prevent that. Application names on the home screen are limited to a maximum of 12 characters. Anything beyond that will be truncated by placing an ellipsis in the middle of the name.

不,没有办法阻止这一点。主屏幕上的应用程序名称限制为最多12个字符。超出此范围的任何内容都将通过在名称中间放置省略号来截断。

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. See the other answers for possible ways of doing that.

如果您想要防止它被切断,您需要在iPhone上保留13个字符以下的网站标题。请参阅其他答案,了解可能的方法。

Update: As of iOS 6, you can use a meta tag to set the name of your application as displayed on the home screen. Full details and instructions are available here.

更新:从iOS 6开始,您可以使用元标记设置主屏幕上显示的应用程序名称。这里有完整的详细信息和说明。

#2


22  

Apparently there will be a undocumented meta tag

显然会有一个未记录的元标记

<meta name="apple-mobile-web-app-title" content="Title">

in iOS 6 to solve that issue.

在iOS 6中解决该问题。

#3


10  

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.

但你不能使用完整的标题。

#4


0  

You can change the title for iOS devices as woodleader has answered but this will change it in normal mobile safari. Only the user can change the title of the 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.

您可以在woodleader已经回答的情况下更改iOS设备的标题,但这会在正常的移动版游戏中更改它。只有用户才能更改webapp的标题。使用元标记或以编程方式执行此操作是不可能的。因此,您只需选择较短的标题或将其留给用户,如果时间过长,可能会更改标题。