ios - 删除 TabGroup 选项卡标题并仅在适用于 iOS 的 Appcelerator 应用程序上显示图标

标签 ios titanium appcelerator titanium-alloy

如何在适用于 iOS 的 Appcelerator 应用程序的 TabGroup 中的选项卡中隐藏“标题”文本?

默认情况下,如果我将 title 属性留空,它会在通常出现标题的地方留下额外的空间。

“标题”文本的显示方式:

enter image description here

没有“标题”文本时的显示方式:

enter image description here

我希望它如何显示:

enter image description here

最佳答案

此修复程序有效,尽管它有点老套:

  1. 转到 /Users/[您的姓名]/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/iphone/Classes/

  2. 在 Appcelerator Studio 中打开文件“TiUITabProxy.m”并进行以下更新。

  3. 在 TiUITabProxy.m 中搜索“(void)updateTabBarItem”并插入此行:

    [ourItem setImageInsets:UIEdgeInsetsMake(6, 0, -6, 0)];

    在函数末尾的以下行之前:

    [rootController setTabBarItem:ourItem];

  4. 清理您的项目并重建。

有一个已打开的 JIRA 票据可以将其添加到 Titanium 中:https://jira.appcelerator.org/browse/TIMOB-18515

该解决方案最初在 Appcelerator 社区论坛中提供,网址为 https://community.appcelerator.com/topic/2878/remove-tabgroup-tab-title-and-show-only-icon-on-ios/7

关于ios - 删除 TabGroup 选项卡标题并仅在适用于 iOS 的 Appcelerator 应用程序上显示图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31792751/

相关文章:

javascript - 动态添加钛 TableView 中的值

android - 无法使用 Titanium Appcelerator(Web 应用程序)查看日志

iphone - 链接到 yaml 框架时遇到问题

ios - Swift 自定义单元格如果要在标签文本框之间更改

ios - iOS 的 ScrollView 中缺少 TextInput,但 Android 中没有

android - Titanium.Geolocation.getCurrentPosition() 不给出输出

javascript - 使用钛合金的翻转动画的错误

ios - 本地化 XIB,Xcode 6 上的不同方法

python - 使用 Appcelerator 在 mac 上获取 safari 和 chrome 打开的选项卡

javascript - 如何让 android studio 和 appcelerator titan 一起工作