自定义标签组应用程序[英] Custom Tabgroup Appcelerator

本文是小编为大家收集整理的关于自定义标签组应用程序的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我正在尝试在AppCelerator中制作一个自定义的TABGroup,其中一个(或两个)比其余部分大.我已经附上了我想实现的图像.

我能够制作一个自定义的TABGroup,但是每次更改选项卡时,它都会刷新,并且我希望我的选项卡像本机TabGroup一样行为.任何帮助都将不胜感激

 example

推荐答案

我弄清楚了这个问题.对于将来有同样问题的任何人来说,这都应该有所帮助:TABGroup是其自己的观点.如果要添加叠加层,请制作一个新视图,然后将其添加到TABGroup,而不是在窗口本身中.

其他推荐答案

如您在评论中所述,在iOS上,标签组本身是一个视图.您可以向其添加视图,无论哪个标签处于活动状态,它们都会持续存在.因为您可以通过编程方式更改活动选项卡,所以您可以在"正常"选项卡组的顶部叠加视图,并使用它们来确定哪个选项卡应该处于活动状态.

以下要点证明了这一点: https://gist.github.com/853935

其他推荐答案

这看起来也很有希望:

https://github.com/viezel/nappui#tabgroup

您可以为活动选项卡背景设置背景图像.这种方法的优点是它使用本机iOS API.实际上,它将扩展钛TabGroup代理并添加一些方法.无需黑客.

本文地址:https://www.itbaoku.cn/post/1938182.html

问题描述

I'm trying to make a custom tabgroup in appcelerator in which one (or two) of the tabs is bigger than the rest. I have attached an image of what I'm trying to pull off.

I am able to make a custom tabgroup, but it refreshes each time I change a tab, and I want my tabs to behave like a native tabgroup. Any help would be much appreciated

Example

推荐答案

I figured out this issue. For anyone that has this same issue in the future this should help: The tabgroup is its own view. If you want to add overlays to it, make a new view, and add it to the tabgroup, NOT to the window itself.

其他推荐答案

As you mentioned in a comment, on iOS the tab group it itself a view. You can add views to it, and they will persist regardless of which tab is active. Because you can programmatically change the active tab, you can overlay views on top of the normal tab group and use them to decide which tab should be active.

The following Gist demonstrates this: https://gist.github.com/853935

其他推荐答案

This also looks promising:

https://github.com/viezel/NappUI#tabgroup

You can set a background image for active tab background. The advantage to this approach is that it uses the native iOS API. Actually, it will extend the Titanium tabgroup proxy and add some methods. No hacks required.