如何使用 Titanium 创建凸起的选项卡栏项目,例如 Instagram 中的选项卡栏项目?
我正在尝试创建一个像 Instragram 上的菜单一样的菜单,其中中心项目使用特殊设计,但 Titanium 文档没有提供有关此类功能的信息
这里有一个已回答问题的示例:如何创建凸起标签栏项目,就像在 Instagram 中找到的那样?,但我需要它在钛上工作,有任何线索吗?
I am trying to create a menu like the one on Instragram, with the central item using a special design, but the Titanium Documentation does not provide information about this kind of feature
There's an example with an already answered question in here: How do you create a raised tab bar item, like is found in Instagram? but I need it working on titanium, any clues?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以按照以下步骤进行模仿;
(这是 hackish,但目前是唯一的方法)
创建选项卡组
根据需要添加选项卡
创建一个没有标题的按钮来模仿 Instagram 中凸起的标签栏。
将该按钮添加到选项卡组。
(希望有一天钛也支持更多低级 API)
You can mimic that by following these steps;
(This is hackish but the only way for now)
Create the tab group
Add tabs as much as you need
Create a button without a title to mimic the raised tab bar like in Instagram.
Add that button to the tab group.
(hope someday titanium supports more low level APIs as well)
我相信 Instagram 是用 Objective-C 编写的。创建自定义选项卡栏就像他们所做的那样涉及对本机选项卡栏进行子类化,但您无法仅使用 JS 和 Titanium 来做到这一点。
这是一个在 Titanium 中伪造自定义标签栏的教程,其中涉及创建一个带有控制真实标签栏的按钮的窗口。
http://www.samjordan。 co.uk/2011/02/tutorial-custom-iphone-tabbar-using-appcelerator-titanium/
I believe Instagram is written in Objective-C. Creating a custom tab bar as they have made involves subclassing the native tab bar, but you don't have the ability to do that with just JS and Titanium.
Here's a tutorial for faking a custom tab bar in Titanium, which involves creating a window with buttons that controls the real tab bar.
http://www.samjordan.co.uk/2011/02/tutorial-custom-iphone-tabbar-using-appcelerator-titanium/
我不知道 Instragram 是在 Titanium 中为哪个平台开发的,但我知道这种类型的选项卡。我为我的一个项目创建了类似类型的选项卡,所以我可以说这不是内置选项卡,您必须自己创建它。
您必须设计图标、背景、凸起背景并编写逻辑,才能使用可用的 UI 小部件(如视图、图像视图和标签)使此工作与选项卡相同。
希望你能够为此编写逻辑。据我所知,这不是内置选项卡,而是自定义选项卡。
I don't know for which platform Instragram is developed in Titanium but I know about this type of tabs. I have created similar type of tab for one of my project so i can say that this is not built in tab you have to create it at your own.
you have to design icons, backgrounds, raised background and write logic to get this work same as Tab using available UI widgets like views, imageview and labe.
Hope you will be able write logic for this. According to my knowledge this is not built in tab, it's a custom tab.