[TIMOB-25356] Android: Ti.UI.SIZE height not working for ListView (SDK 6.2.X)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2017-09-29T14:27:24.000+0000 |
Affected Version/s | Release 6.2.2 |
Fix Version/s | n/a |
Components | Android |
Labels | bug, listview |
Reporter | Guillermo Figueras |
Assignee | Joshua Quick |
Created | 2017-09-28T10:57:54.000+0000 |
Updated | 2017-09-29T14:27:33.000+0000 |
Description
When using SDK 6.2.0GA, 6.2.1.GA or 6.2.2GA on Android, a ListView will not behave as expected when setting height to Ti.UI.SIZE.
If I use SDK 6.1.2GA it will resize as expected.
See images attached and code below.
view.xml:
<ScrollView id="scrollView" height="0" layout="vertical">
<CardView id="locationsCard" height="0" >
<ListView id="locationsList" defaultItemTemplate="template" touchEnabled="false" >
<Templates>
<ItemTemplate name="template" height="Ti.UI.SIZE" width="Ti.UI.FILL" >
<View class="itemView" onClick="get_place">
<ImageView class="icons" image="/icons/location.png" touchEnabled="false" />
<View class="locationView" touchEnabled="false" >
<Label bindId="mainText" class="titleLabel smallText" touchEnabled="false" />
<Label bindId="secondaryText" class="subtitleLabel smallText" touchEnabled="false" />
</View>
</View>
<View class="separator" bindId="separator" touchEnabled="false" />
</ItemTemplate>
<ItemTemplate name="template2" height="Ti.UI.SIZE" width="Ti.UI.FILL" top="8dp" bottom="8dp">
<View class="itemView" onClick="get_place">
<ImageView class="icons" image="/icons/location.png" touchEnabled="false" />
<View class="locationView" touchEnabled="false" >
<Label bindId="mainText" class="titleLabel smallText" touchEnabled="false" />
</View>
</View>
<View class="separator" bindId="separator" touchEnabled="false" />
</ItemTemplate>
</Templates>
<ListSection id="section" backgroundColor="white" />
</ListView>
</CardView>
<CardView id="selectCard">
<View layout='horizontal' backgroundColor="#fafafa" touchFeedback="true" touchFeedbackColor="#808080" onClick="selectInMap">
<ImageView class="icons" id="locationIcon" image="/icons/address.png" touchEnabled="false" />
<Label class="titleLabel smallText" text="L('selectInMap')" touchEnabled="false" />
</View>
</CardView>
</ScrollView>
tss:
'CardView': {
width: Ti.UI.FILL,
height: Ti.UI.SIZE,
left: "10dp",
right: "10dp",
contentPadding: 40,
cardCornerRadius: 20,
cardUseCompatPadding: true,
backgroundColor: "#fafafa"
}
".smallText" :{
left: "16dp",
font: {
fontSize: "14sp"
}
}
".titleLabel" : {
color: "#212121"
}
".subtitleLabel" : {
color: "#757575"
}
"#locationsCard" : {
top: "10dp",
bottom: "10dp",
layout: 'vertical',
height: Ti.UI.SIZE
}
"#locationsList" : {
top: "16dp",
left: "16dp",
right: "16dp",
bottom: "16dp",
canScroll: false,
showVerticalScrollIndicator: false,
height: Ti.UI.SIZE
}
".itemView" : {
top: "8dp",
bottom: "8dp",
layout: 'horizontal',
height: Ti.UI.SIZE,
backgroundColor: "#fafafa",
touchFeedback: true,
touchFeedbackColor: "#808080"
}
".icons" : {
width: "24dp",
height: "24dp"
}
".locationView" : {
layout: 'vertical',
height: Ti.UI.SIZE,
width: Ti.UI.FILL
}
".separator" : {
bottom: "0",
height: "1",
width: Ti.UI.FILL,
left: "40dp",
right: 0,
backgroundColor: "#d3d3d3",
}
"#selectCard" : {
top: "10dp",
bottom: "10dp",
height: "48dp",
layout: 'horizontal',
backgroundColor: '#fafafa'
}
Attachments
File | Date | Size |
---|---|---|
SDK 6.1.2GA correct.png | 2017-09-28T10:46:35.000+0000 | 61795 |
SDK 6.2.2GA wrong.png | 2017-09-28T10:46:35.000+0000 | 57003 |
Thanks for reporting this. This is already a known issue. See [TIMOB-25258], which already has a pending fix awaiting a review. This fix is scheduled to be added to 6.3.0.