Bug 17612 - Bizzare bug in UIPickerView - components reversed
Summary: Bizzare bug in UIPickerView - components reversed
Status: RESOLVED DUPLICATE of bug 17597
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 7.0.6.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-02-05 09:49 UTC by BB
Modified: 2014-02-11 20:50 UTC (History)
6 users (show)

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

Solution demonstrating Picker Issues that I described above (1.38 MB, application/zip)
2014-02-11 05:33 UTC, Alek Slater

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:

Description BB 2014-02-05 09:49:52 UTC
I have a subclass of UIPickerViewModel to display two columns:

  DATE   |    TIME

It all works fine in simulator (Debug and Release) and is OK on real devices in release. But in DEBUG on a real iPhone or iPad, the columns are displayed on top of each other or even reversed (when different widths are used)! i.e.:

  TIME   |   DATE

This is the code that shows them on top of each other (in DEBUG on real devices):

    private class PickerViewModelX : UIPickerViewModel

        public PickerViewModelX()

	public override int GetComponentCount(UIPickerView picker)
		return 2;

	public override float GetComponentWidth(UIPickerView picker, int component)
		return 100.0f;

	public override float GetRowHeight(UIPickerView picker, int component)
		return 44.0f;

	public override int GetRowsInComponent(UIPickerView picker, int component)
		return 10;

	public override UIView GetView(UIPickerView picker, int row, int component, UIView view)
		UILabel label = (UILabel)view;
		if (label == null)
			label = new UILabel(new RectangleF(0.0f, 0.0f, 100.0f, 44.0f));
		label.Text = (component == 0 ? "DATE" : "TIME");
		return label;

It something to do with component widths, I think.

Very strange bug. 




=== Xamarin Studio ===

Version 4.2.2 (build 2)
	Mono 3.2.6 ((no/9b58377)
	GTK+ 2.24.23 theme: Raleigh
	GTK# (
	Package version: 302060000

=== Apple Developer Tools ===

Xcode 5.0.2 (3335.32)
Build 5A3005

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 2ed9bc9
Build date: 2014-21-01 06:33:05-0500

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Xamarin.Android ===

Version: 4.10.1 (Starter Edition)
Android SDK: /Users/billbatchelor/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Build Information ===

Release ID: 402020002
Git revision: c5f82958ae7d9af652b44b87ceff777b3ad19b91
Build date: 2013-11-19 15:35:40+0000
Xamarin addins: a4044fee09138f6fd031a9944b7caaeb51e57e80

=== Operating System ===

Mac OS X 10.9.1
Darwin BB-Mac-mini.local 13.0.0 Darwin Kernel Version 13.0.0
    Thu Sep 19 22:22:27 PDT 2013
    root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
Comment 2 BB 2014-02-05 10:26:47 UTC
This is on iOS 7.0.4

- It happens on an iPhone 5s and iPad mini both with iOS 7.0.4

And only happens with DEBUG builds.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2014-02-10 07:15:27 UTC
This might be a dup of bug #17597 - but we'd need a complete test project to be able to confirm.
Comment 4 Matt Jones 2014-02-10 11:32:17 UTC
My problems with pickers that have been introduced in the latest build do not go away with release builds - they're there in both types. Still trying to work out exactly which logged bug mine match though.
Comment 5 Alek Slater 2014-02-11 04:59:38 UTC
Same here, doesn't work at all on the devices in either Release or Debug, but works fine on the Simulator. Some observations I've made thus far 
* If GetComponentWidth is not overridden in the UIPickerViewModel subclass with just 1 column it works fine
* If GetComponentWidth is overridden, with 2 columns it doesn't work (I then get the same behaviour as BB described above)
* If GetComponentWidth is overridden with a width of 300 and with 1 column, nothing is displayed at all in the picker.
Comment 6 Alek Slater 2014-02-11 05:33:25 UTC
Created attachment 6024 [details]
Solution demonstrating Picker Issues that I described above
Comment 7 Rolf Bjarne Kvinge [MSFT] 2014-02-11 05:40:07 UTC
@Alex Slater, your project works fine with the fix for bug #17597, so I'm marking this as a duplicate.

*** This bug has been marked as a duplicate of bug 17597 ***
Comment 8 Alek Slater 2014-02-11 06:13:25 UTC
Rolf: both 2 issues? I had 3 different models, did you try all of them ?
Comment 9 Rolf Bjarne Kvinge [MSFT] 2014-02-11 08:30:08 UTC
@Alex, yes, all three models have identical behavior between the simulator and device now.
Comment 10 Alek Slater 2014-02-11 11:19:35 UTC
@Rolf, awesome, thx, is there an ETA of the patch ?
Comment 11 Rolf Bjarne Kvinge [MSFT] 2014-02-11 11:27:04 UTC
@Alek, we'll probably release a new beta version (7.0.7) later this week or next week with this patch.
Comment 12 Atin 2014-02-11 11:52:47 UTC
Today, we have checked this issue with:

ML 10.8.5
XS 4.2.4(build 14)- d36f82139fd61a0cda68d5baabb1c7b8402116b9
MT 7.0.7
Xcode 5.0
Device info: iPad 7.0.4

Now this issue is working fine, the scrolling stops when we lift the finger
from iPad screen. Hence marking this as Verified
Comment 13 Alek Slater 2014-02-11 20:50:11 UTC
@Rolf, brilliant, thanks.