Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1747] Alloy: HeaderView not working on android

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2013-03-25T21:06:58.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsalloy
ReporterAlejandro Del Rio Albrechet
AssigneeMauro Parra-Miranda
Created2013-03-25T11:49:58.000+0000
Updated2016-03-08T07:40:38.000+0000

Description

I am trying to create a tableviewsection for tableview with alloy markup and in tss make styling for it. here is a code I think the problem is in creation header view on creation:
<Alloy>
    <Window id="settings" title="Settings" layout="vertical">
         <TableView id="settingTable">
            <TableViewSection>
                <HeaderView>
                    <View class="sectionHeaderView">
                        <Label id="userInfoSectionLabel" class="headerViewLabel" />
                    </View>
                </HeaderView>
                <TableViewRow>
                	<View class="panel">
	                	<Label id="emailLabel" class="left" />
	                	<Label id="emailValueLabel" class="right" /> 
                	</View>
                </TableViewRow>
                <TableViewRow>
                	<View class="panel">
	                	<Label id="usernameLabel" class="left" />
	                	<Label id="usernameValueLabel" class="right" />
                	</View>
                </TableViewRow>
                <TableViewRow>
                	<View class="panel">
	                	<Label id="passwordLabel" class="left" />
	                	<Label id="passwordValueLabel" class="right" />
                	</View>
                </TableViewRow>
            </TableViewSection>
            <TableViewSection>    
                <HeaderView>
                    <View class="sectionHeaderView">
                        <Label id="personalInfoSectionLabel" class="headerViewLabel" />
                    </View>
                </HeaderView>   
                <TableViewRow>
                	<View class="panel">	
	                	<Label id="nameLabel" class="left"  />
	                	<Label id="nameValueLabel" class="right"  />
                	</View>
                </TableViewRow>
                <TableViewRow>
                	<View class="panel">
	                	<Label id="addressLabel" class="left"  />
	                	<Label id="addressValueLabel" class="right"  />
                	</View>
                </TableViewRow>
                <TableViewRow>
                	<View class="panel">
	                	<Label id="cityLabel" class="left"  />
	                	<Label id="cityValueLabel" class="right"  />
                	</View>
                </TableViewRow>
            </TableViewSection>
        </TableView>   
    </Window>
</Alloy>
in tss file I do something like that:
".sectionHeaderView[platform=android]" : 
    {
        width:                  Ti.UI.FILL
    ,   height:                 "25dp"
    ,   backgroundColor:        "#7d820c"   
    }
,   ".headerViewLabel[platform=android]" : 
    {
        left:                   "5dp"
    ,   height:                 "25dp"
    ,   textAlign:              Ti.UI.TEXT_ALIGNMENT_LEFT
    ,   font: 
        {
            fontSize:           "15dp"
        ,   fontWeight:         "bold"  
        }
    ,   color:                  "#fff"
    ,   width:                  Ti.UI.FILL
    }
,   ".sectionHeaderView" : 
    {
        height:                 "30dp"
    ,   font: {
            fontSize:           "14dp"
        }
    ,   width:                  Ti.UI.FILL
    }
,   ".headerViewLabel" : 
    {
        textAlign:              Ti.UI.TEXT_ALIGNMENT_CENTER
    ,   font: {
            fontSize:           "20dp"
        ,   fontWeight :        "bold"
        }
    ,   width:                  Ti.UI.FILL
    ,   color:                  "#4169E1"
    }

Comments

  1. Carter Lathrop 2013-03-25

    Alejandro, Are you able to confirm that this issue is only in alloy? Also can you provide the Ti SDK you are testing on, the Titanium build you are using as well as the android OS version you are seeing the issue on? Thank you, Carter
  2. Tony Lukasavage 2013-03-25

    I don't have it off-hand, but there already exists a TIMOB ticket for fixing Android headerViews that are added after the table's creation.
  3. Carter Lathrop 2013-03-25

  4. Mauro Parra-Miranda 2013-11-24

    DUP issue.

JSON Source