0
  • Application Type: mobile
  • Titanium SDK: 3.1.1.GA
  • Platform & Version: iOS 6.1
  • Device: iOS Simulator
  • Host Operating System: OSX 10.8.4
  • Titanium Studio: 3.1.1.201306112235

I've got a SplitWindow control in my Alloy app and I can't seem to get the Title or TitleControl to display for the master and detail windows. I've found in the JIRA that Alloy doesn't support TitleControl for SplitWindow Windows yet, but even creating them in JS doesn't seem to work. I've included my code below. Here's a screenshot of how the SplitWindow is being rendered.

settings.xml

<Alloy>
    <SplitWindow id="settings" navBarHidden="false">
        <Window id="master_window" navBarHidden="false">
        </Window>

        <Window id="detail_window" navBarHidden="false">
        </Window>
    </SplitWindow>
</Alloy>

settings.js

function bind() {

    $.master_window.setNavBarHidden(false);
    $.master_window.setTitle('Title here'); 

};

bind();
ShawnCBerg
  • 594
  • 2
  • 7
  • 27

1 Answers1

0
<Alloy>
    <SplitWindow id="index" formFactor="tablet">
        <Window>
            <NavigationGroup id="masterView">
                <Window id="master_window" navBarHidden="false"  title="Master"></Window>
            </NavigationGroup>
        </Window>
        <Window>
            <NavigationGroup id="detailView">
                <Window id="detail_window" navBarHidden="false" title="Detail">
                    <ListView id="list" defaultItemTemplate="template1"></ListView>
                </Window>
            </NavigationGroup>
        </Window>
    </SplitWindow>
</Alloy>

to show the titles you need either a NavigationGroup or a TabGroup

enter image description here

here is a similar example, but using a TabGroup to show the titles instead of the NavigationGroup

<Alloy>
    <SplitWindow id="index" formFactor="tablet">
        <!-- use TabGroup to get title to show -->
        <TabGroup>
            <Tab title="tab 1" >
                <!-- hide the tabBar so it looks like a regular window -->
                <Window id="master_window" tabBarHidden="true"  title="Master"></Window>
            </Tab>
        </TabGroup>
        <Window>
            <!-- use NavigationGroup to get title to show -->
            <NavigationGroup id="detailView">
                <Window id="detail_window" navBarHidden="false" title="Detail">
                    <ListView id="list" defaultItemTemplate="template1"></ListView>
                </Window>
            </NavigationGroup>
        </Window>
    </SplitWindow>
</Alloy>
Aaron Saunders
  • 33,180
  • 5
  • 60
  • 80