Blog » Mobile Titanium Invalid <TabGroup> child type: Alloy.Require
Post at 06 Apr 2015 15:51
When I try to compile the code of Building Cross-Platform Apps using Titanium, Alloy, and Appcelerator Cloud Services Chapter 5, Titanium reports
"[ERROR]: Invalid <TabGroup> child type: Alloy.Require"
<!-- index.xml --> <Alloy> <TabGroup> <!-- Tabs included via <Require> tag --> <Require id="feedController" src="feed"/> <Require id="friendsController" src="friends"/> <Require id="settingsController" src="settings"/> </TabGroup> </Alloy>
I found a article about it, but the answer didn't work.
http://developer.appcelerator.com/question/158855/unable-to-use-require-src-with-tabgroup
According to the following manual, the code should be modified with a type="view" in <Require> tag, or put <Require> tag within <Window> tag.
http://docs.appcelerator.com/titanium/latest/#!/guide/Alloy_XML_Markup-section-35621528_AlloyXMLMarkup-RequireElement
<!-- index.xml --> <Alloy> <TabGroup> <!-- Tabs included via <Require> tag --> <Tab title="Feed" icon="KS_nav_ui.png"> <Require type="view" id="feedController" src="feed"/> </Tab> <Tab title="Friends" icon="KS_nav_views.png"> <Window title="Friends"> <Require id="friendsController" src="friends"/> </Window> </Tab> <Tab title="Settings" icon="KS_nav_views.png"> <Window title="Settings"> <Require id="settingsController" src="settings"/> </Window> </Tab> </TabGroup> </Alloy>
Of course in the corresponding view of tab, We should remove the duplicated tag, such as tab or window:
<!-- feed.xml --> <Alloy> <Window title="Feed"> <Label>This is a Feed tab</Label> </Window> </Alloy>
Rating
Comment