Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23436] iOS: ListView Control's height not setting correctly

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-07-20T22:18:08.000+0000
Affected Version/sRelease 5.2.2
Fix Version/sRelease 6.2.0
ComponentsiOS
Labelsdefect, ios
ReporterGaurang Chhatbar
AssigneeVijay Singh
Created2016-05-23T16:30:04.000+0000
Updated2017-09-24T09:41:06.000+0000

Description

<Alloy>
	<Window>
		<ListView id="listView" defaultItemTemplate="videoTemplate" separatorHeight="4">
			<Templates>
				<ItemTemplate name="videoTemplate">
					<View id="itemContainer" bindId="containerMain" height="600" width="900">
						<ImageView id="imgVideo" bindId="imgVideo" height="600" width="900" ></ImageView>
					</View>
				</ItemTemplate>
			</Templates>
			<ListSection>
				<HeaderView>
					<View backgroundColor="green" height="Ti.UI.SIZE">
						<Label id="lblHeader" left="10" top="3" bottom="3">Testing</Label>
					</View>
				</HeaderView>
				<FooterView>
					<View backgroundColor="green" height="6"></View>
				</FooterView>
			</ListSection>
		</ListView>
	</Window>
</Alloy>
var loadData = function(e) {
			var listItems = [];
				for (var i = 0; i < 100; i++) {
					listItems.push({					
						imgVideo : {image :  "/images/Default.png"}
						
					});
				}
				$.listView.sections[0].appendItems(listItems);

};

loadData();
$.index.open();
I am creating listing in listview and its working fine in android as expected. When I run iOS, it shows misbehaviour in rendering listview. it shows only one view bigger as same as given height and others are renders smaller with equal height. when I scroll down it maximise view once to given height one by one which is scrolling currently. It should be remain same when It maximised but when I scroll in reverse direction then it shows all scrolled control with same size again. when I click at any row then it expand to given height but after scroll out of the screen it fixed to default height. I used inbuilt image.

Attachments

FileDateSize
Listview.swf2016-05-23T16:27:18.000+00009654148
Screen Shot 2016-05-23 at 9.35.44 PM.png2016-05-23T16:17:29.000+0000237474
Simulator Screen Shot 23-May-2016, 9.39.48 PM.png2016-05-23T16:17:32.000+0000718762

Comments

  1. Gaurang Chhatbar 2016-06-03

    Hello All, is any update available in next week for this issue?
  2. Vijay Singh 2017-04-05

    Test Case :
       var win = Ti.UI.createWindow({
           backgroundColor: '#fff'
       });
       
       var myTemplate = {
               childTemplates: [{
                   type: 'Ti.UI.ImageView',
                   bindId: 'pic',
                   properties: {
                        height: 600,
                        width:900
                   }
               }]
       };
       
       var list = Ti.UI.createListView({
           templates:{'template':myTemplate},
           defaultItemTemplate: 'template',
       });
       var sections = [];
       var imgSection = Ti.UI.createListSection({headerTitle:'Test Image Template'});
       var listItems = [];
       for (var i = 0; i < 5; i++) {
           listItems.push({pic:
               {image : 'image.JPG'}
           });
       }
       imgSection.setItems(listItems);
       sections.push(imgSection);
       list.setSections(sections);
       win.add(list);
       win.open();
       
  3. Vijay Singh 2017-04-06

    PR: https://github.com/appcelerator/titanium_mobile/pull/8937
  4. Samir Mohammed 2017-08-08

    Verified fix in SDK Version 6.2.0.v20170808135421 and SDK Version 7.0.0.v20170808071205. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/8937

JSON Source