开发者

Flex: Is it possible to hide some tabs in tab navigator and show them only when certain event occurs

I am using tab navigator. And it has thee tabs "Search", "Show as text", "Show on map"

I have a addres开发者_开发百科s search box in Search tab. I would like to hide other two tabs if search has not happened yet. So if user hasn't searched any thing other two tabs shouldn't be visible.

Can you please tell me how can I achieve this?

Hiding tabs is a preferred way. Second option is to disable tabs until search is done.


There are a couple ways to do this.

  1. Use the TabNavigator's getTabAt() method which returns the Button that makes up the visual tab and set the visible property to false. It can be tricky with bindings.

  2. The other option is to addChildAt or removeChildAt on the TabNavigaor depending on what tabs you want to show or hide.

  3. As you mention disabling could also work. Do this by as well setting the tab's container to disabled.


I had used removeChildAt on tab navigator and works fine. But if you want to do specific actions on selected Tab then you should think about other solution because the removedChild is no longer available in tab navigator.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜