Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-16-2010, 05:06 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 24
snorkelt is on a distinguished road
Default broken picker selection indicator

I have a three-component picker.
My problem is that, when the Selection Indicator is showing, the grey bar is in the right place (halfway down the picker), but the clear-looking overlay is too low. Normally you'd never see the selection indicator broken up this way.
If the setShowsSelectionIndicator is set to NO, it looks ok, but hard to use (can't see what is selected -- just have to assume the middle row is selected).
If selectRow:4 inComponent:0 animated:YES, it still doesn't look right. If I reload the components, it still doesn't look right.
The only thing that makes it look right is commenting out the selectRow inComponent animated. Looks right but I do want it to show what row the user previously selected.

It doesn't exactly work properly, either: I cannot select the last row in each component. As a matter of fact, the last row shows up under the clear bar (which is too low) when I try to select the last row, but because that is a row below the grey bar, I can only select down to the next-to-the-last-row.

Code:
mypicker = [[UIPickerView alloc] init];
	[mypicker setDataSource:self];
	[mypicker setDelegate:self];
	mypickerTitles_Dil = [[NSArray alloc] initWithObjects:@"A", "B", "C", "D", "E", "F, "G", nil];
	mypickerTitles_Eff = [[NSArray alloc] initWithObjects:@"A", "B", "C", "D", "E", "F, "G", "H", "I", "J", nil];
	mypickerTitles_Stat = [[NSArray alloc] initWithObjects:@"A", "B", "C", "D", "E", "F, "G", nil];
	[mypicker setShowsSelectionIndicator:YES];
	
	//commenting out the next three lines makes the picker look right (but not properly populated with the 4th row of course). 
	
	[mypicker selectRow:4 inComponent:0 animated:NO];
	[mypicker selectRow:4 inComponent:1 animated:NO];
	[mypicker selectRow:4 inComponent:2 animated:NO];
	[mypicker setFrame:CGRectMake(0, 98, 320, 253)];
	[self addSubview:mypicker];
I could probably email someone a screenshot if that would help (so hard to describe). Thanks!
snorkelt is offline   Reply With Quote
Old 10-19-2010, 02:31 PM   #2 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 24
snorkelt is on a distinguished road
Default

PROBLEM FIXED: picker height is fixed at 216. Because I went over at 253, all the other problems followed.
snorkelt is offline   Reply With Quote
Reply

Bookmarks

Tags
indicator, picker, pickerview, row, selection

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 338
8 members and 330 guests
Desert Diva, dre, hain, HemiMG, mottdog, oceanlablight, schmallegory
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,895
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:09 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0