[TIMOB-19695] Android: TabGroup cannot use "NoTitleBar" themes
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2019-01-11T01:31:34.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 8.0.0 |
| Components | Android |
| Labels | ActionBar, TabGroup, android, tabs, theme, titlebar |
| Reporter | Fokke Zandbergen |
| Assignee | Yordan Banev |
| Created | 2015-10-09T09:22:42.000+0000 |
| Updated | 2019-01-11T01:31:41.000+0000 |
Description
When you use a
NoTitleBar theme for the application, it is impossible to use a TabGroup anywhere in the application, because it requires an ActionBar:
1. Create default classic project (which has a TabGroup)
2. In tiapp.xml select a NoTitleBar theme:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<application theme="@style/Theme.AppCompat.NoTitleBar" />
</manifest>
</android>
3. Run the project and see that the screen is empty (as in screenshot) and logs show:
[ERROR] TabGroupProxy: (main) [362,362] ActionBar not available for TabGroup
Solution
We should support thetheme property we have for [Ti.UI.Window](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Window-property-theme) so you can select a theme that *has* a TitleBar when you create a TabGroup in an application that uses a NoTitleBar theme.
Workaround
On all other windows, use thetheme property to select a NoTitleBar theme.
Attachments
| File | Date | Size |
|---|---|---|
| android_20151009-111248.png | 2015-10-09T09:22:36.000+0000 | 26617 |
| android_20151009-111406.png | 2015-10-09T09:22:37.000+0000 | 46600 |
$.tabGroup.addEventListener('focus', function(e) { var actionBar = $.tabGroup.getActivity().actionBar; if (actionBar) { actionBar.setDisplayShowTitleEnabled(false);// works } });
[~m.afzal.786.220] that's to hide the action bar, the ticket is about setting a specific theme, like you can do when you create a window.
I have same issue. If we are developing new Application then we can consider this solution/workaround.But when we are upgrading (Ti SDK) our existing app then we need to do these changes in many file, This is increasing both developing and testing effort. Hope this issue will be resolved soon.
TabGroupwas refactored in Titanium 8.0.0 so that tabs are no longer implemented via theActionBar. This means that theActionBarcan now be removed via a theme (such as "Theme.AppCompat.NoTitleBar") without issue. See ticket [TIMOB-26354] for more details.