Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

layout horizontal, different result on iphone to android

$
0
0

Alloy 3.2. I have the following code, the layout on android works as expected, ie all data on one line laid out side by side. However, on the iphone, the image and text are centred, just as I would expect from composite layout. The tss section is being used, I've chenged the background colour in there. I've also tried horizontalWrap, false. All to no avail. I'm sure I'm making a silly mistake somewhere. Anyone any ideas, please?

View:

<Alloy>
 
    <Collection src="branch" id="vbranchinstance" instance="true"/>
 
    <View class="container">
 
        <ListView onItemclick="show_details" id="list" defaultItemTemplate="title">
            <Templates>
                <ItemTemplate name="fullItem" height="70">
                    <ImageView bindId="logo" class="image" defaultImage="images/cheese.jpg"/>
                    <Label bindId="title" class="title text-and-image"/>
                    <Label bindId="subtitle" class="subtitle text-and-image"/>
                    <Label bindId="foo" color="red" />
                </ItemTemplate>
                <ItemTemplate name="titleAndSub" height="70">
                    <Label bindId="title" class="title"/>
                    <Label bindId="subtitle" class="subtitle"/>
                </ItemTemplate>
                <ItemTemplate name="title" height="50">
                    <Label bindId="title" class="title"/>
                </ItemTemplate>
            </Templates>
 
            <!-- template could be decided by webservices -->
            <ListSection id="section" dataCollection="$.vbranchinstance">
                <ListItem class="listitem" template="fullItem" branch_id="{id}" foo:text="{cpy_logo}" title:text="{branchname}" subtitle:text="{branchaddr1}" logo:image="{cpy_logo_url}"/>
            </ListSection>
        </ListView>
 
    </View>
 
</Alloy>
Stylesheet:
".container": {
    backgroundColor: 'green',
    // This is the height as set out in topbar.tss
    //height:          '100dp',
    bottom:          '60dp',
    top:             '60dp',
    border: '2px',
    borderColor: 'blue'
}
 
"#list": {
    backgroundColor: '#dea',
    // This is the height as set out in tabgroup.tss
    // height:          '80dp',
    // bottom:          '80dp',
    // top:             '60dp'
}
 
".listitem": {
    layout: 'horizontal'
}

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>