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-21-2010, 06:04 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 150
ikaroweb is on a distinguished road
Default Aadding image & text on same row to a uipickerview

Hello all,
Thanks in advance for any help you may provide.

I'm tring to add an image and text on same row to a uipickerview without success.
Can someone help me?

Thanks

Ika
ikaroweb is offline   Reply With Quote
Old 10-21-2010, 08:39 AM   #2 (permalink)
Registered Member
 
manicaesar's Avatar
 
Join Date: Feb 2009
Location: Poznań, Poland
Age: 25
Posts: 103
manicaesar is on a distinguished road
Default

Check out UICatalog sample code - there is a picker you want to create

Sample Code
__________________
Do you like Age Of War? Have you played 'The Wars' and are not fully satisfied? Try Empires At War - we bet you will love it!


------------------
Full Version
------------------
Lite Version
------------------
YouTube Game Trailer
manicaesar is offline   Reply With Quote
Old 10-21-2010, 12:52 PM   #3 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 150
ikaroweb is on a distinguished road
Default

I had already read that code, but frankly I just understood, there is another example to look at?

thanks
ikaroweb is offline   Reply With Quote
Old 10-22-2010, 01:44 AM   #4 (permalink)
Registered Member
 
manicaesar's Avatar
 
Join Date: Feb 2009
Location: Poznań, Poland
Age: 25
Posts: 103
manicaesar is on a distinguished road
Default

Quote:
Originally Posted by ikaroweb View Post
I had already read that code, but frankly I just understood, there is another example to look at?

thanks
Well, to be honest, I find that code very simple. And it produces a row with image and title - so it is just what you need - why don't you just reuse the code? Import CustomPicker and CustomView classes to your project, go to the initWithFrame: method of CustomPicker class and then input the titles and images you want to display.

If you want to display something different in a row of the picker, all you need to do is to implement UIPickerViewDelegate method (in the sample it is done in UIPickerView):
Code:
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row
						forComponent:(NSInteger)component reusingView:(UIView *)view;
In this method you have to construct the view you want to display in a particular row - either by creating your own UIView subclass (CustomView) or create the view dynamically within the method itself.

And then you display the picker just like you display default pickers.
__________________
Do you like Age Of War? Have you played 'The Wars' and are not fully satisfied? Try Empires At War - we bet you will love it!


------------------
Full Version
------------------
Lite Version
------------------
YouTube Game Trailer
manicaesar is offline   Reply With Quote
Old 10-22-2010, 01:45 AM   #5 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 150
ikaroweb is on a distinguished road
Default

Quote:
Originally Posted by manicaesar View Post
Well, to be honest, I find that code very simple. And it produces a row with image and title - so it is just what you need - why don't you just reuse the code? Import CustomPicker and CustomView classes to your project, go to the initWithFrame: method of CustomPicker class and then input the titles and images you want to display.

If you want to display something different in a row of the picker, all you need to do is to implement UIPickerViewDelegate method (in the sample it is done in UIPickerView):
Code:
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row
						forComponent:(NSInteger)component reusingView:(UIView *)view;
In this method you have to construct the view you want to display in a particular row - either by creating your own UIView subclass (CustomView) or create the view dynamically within the method itself.

And then you display the picker just like you display default pickers.
Thank you so much!
If the code had explicit images would have been easier to understand.

Last edited by ikaroweb; 10-22-2010 at 01:48 AM.
ikaroweb is offline   Reply With Quote
Reply

Bookmarks

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: 334
9 members and 325 guests
condor304, Desert Diva, dre, hain, mottdog, oceanlablight, palme2elie, schmallegory
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,658
Threads: 94,118
Posts: 402,895
Top Poster: BrianSlick (7,990)
Welcome to our newest member, palme2elie
Powered by vBadvanced CMPS v3.1.0

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