Custom Tabgroup Appcelerator

2019-07-20 22:04发布

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

3条回答
smile是对你的礼貌
2楼-- · 2019-07-20 22:25

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.

查看更多
倾城 Initia
3楼-- · 2019-07-20 22:47

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.

查看更多
混吃等死
4楼-- · 2019-07-20 22:49

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

查看更多
登录 后发表回答