Bug 17476 - GetCell in UICollectionViewDataSource not being called if only a single item is in the collection in iOS 6.X
Summary: GetCell in UICollectionViewDataSource not being called if only a single item ...
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 7.0.2.x
Hardware: PC Mac OS
: High normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-01-28 15:48 UTC by Jon Goldberger [MSFT]
Modified: 2014-03-19 13:56 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test Project (60.77 KB, application/zip)
2014-01-28 15:48 UTC, Jon Goldberger [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Comment 1 Jon Goldberger [MSFT] 2014-01-28 15:55:15 UTC
The GetCell method in the data source class for a UICollectionView is not getting called if there is only a single item in the collection and the size set in the LineLayout class is greater than 35.0f or the ACTIVE_DISTANCE is > 151. This is only in iOS 6.0 or 6.1, works as expected in iOS 7. 

Run the test project and change the ITEM_SIZE in LineLayout to anything > 35.0f and GetCell will not be called and the single item will not be shown in the Collection view (iOS 6.x). Or increase the ACTIVE_DISTANCE to > 151 and the same occurs. 

In addition, with the ITEM_SIZE set to the original value prior to my testing this issue, which was 180.0f, and the ACTIVE_DISTANCE is set to 180 (original value)  the first item is not shown when there are multiple items in the collection until the collection view is scrolled. Again this is only in iOS 6.0 or 6.1. Works as expected in iOS7.
Comment 2 Ram Chandra 2014-02-26 12:19:39 UTC
I try to reproduce this bug with attached project and i am able to reproduce this bug in iOS 6.0 and iOS 6.1 but it is working fine in iOS 7.

Steps to reproduce:

(1) Open solution file of attached project in Xamarin Studio.
(2) Build and debug the application in iOS 6.0 or 6.1

Screencast : http://screencast.com/t/ykElOimN

Environment : 

Mac OS X 10.8.5
Xamarin Studio : 4.2.4 (build 22)
Xamarin.iOS : 7.0.7.2 

Build Information
Release ID: 402040022
Git revision: 88a98c636089228fcf5eccdb882042e9ae13f1eb
Xamarin addins: ca7644335a81cb1a2e91c8879ef3f08fc28a6065
Comment 3 Sebastien Pouliot 2014-03-19 13:56:09 UTC
2014-03-19 13:49:13.764 CollectionViewImage[3870:907] the behavior of the UICollectionViewFlowLayout is not defined because:
2014-03-19 13:49:13.772 CollectionViewImage[3870:907] the item height must be less that the height of the UICollectionView minus the section insets top and bottom values.

^ this message (from the Application Output or the Xcode console) comes from iOS itself (6.x only, not 7) and tell you whats wrong. If you change your values then it will work (on iOS6) and the message won't be displayed.

IOW this is an iOS change (from 6 to 7) and does not come from Xamarin.iOS (and is out of our control).