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 09-20-2011, 09:26 PM   #1 (permalink)
Banned
 
Join Date: Sep 2011
Posts: 20
Eclectic is on a distinguished road
Default textfield input with slider

Hi,
I need to use a slider to input values into 3 textfields in my program. This is because I want these textfields to accept values between 5 and 30 in increments of 0.5 only. I have already figured out the code for incrementing or decreasing slider value by 0.5 but I need help with two issues:
1. I was wondering how I can prevent the keyboard from popping up every time the textfield has touch up inside event.
2. How I can use one slider for this purpose rather than crowding the interface with 3 sliders.
Thanks for you help.
Eclectic
Eclectic is offline   Reply With Quote
Old 09-20-2011, 11:15 PM   #2 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 651
kapps11 is on a distinguished road
Default

1. Use labels instead of textfields? Or just set userInteractionEnabled to false
2. Its hard to say without a better description of what ur doing. You could use one slider and have the labels say dif things by doing some math on the value of the slider, but if u want 3 independent values then i think ud have to have 3...
kapps11 is offline   Reply With Quote
Old 09-21-2011, 01:42 AM   #3 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 149
crashmonkey is on a distinguished road
Default

To use one slider for 3 textfields you are going to need to implement some mechanism for choosing which textfield is attached to the slider.

You could include a button next to each textfield that when pressed executes a method that connects the slider to that field.

or

You could use a segmented switch with 3 buttons near the slider that performs the same function as the textfield buttons.

If you really must use only 1 slider, maybe you could divide the slider range into 3 equal amounts, like 1 - 10, 11-20, 21- 30. Then when the slider value passes into a new range it switches connection to a new textfield.
Clunky and confusing for the user, and probably awkward to code, but probably doable.
Or I guess as knapps mentioned above, all the textfields are connected, but each one receives a filtered value from its respective range on the slider.
You could use some if statements that perform the math conversion to your desired values when the slider value is within a particular range. The other textfields would not get a new value until the slider moved into its range.
Still awkward though, because to get to any one textfield you have to move the slider to the extreme values of the other textfields, thus changing their values to an undesired value.

I'd say use buttons or 3 sliders.
__________________
Learning IOS development one crash at a time.
crashmonkey is offline   Reply With Quote
Reply

Bookmarks

Tags
uislider, uitextfield

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: 396
14 members and 382 guests
7twenty7, eski, EvilElf, HemiMG, iOS.Lover, jarv, n00b, pbart, Pudding, sacha1996, Sami Gh, UMAD, VinceYuan, yuncarl28
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,672
Threads: 94,121
Posts: 402,905
Top Poster: BrianSlick (7,990)
Welcome to our newest member, yuncarl28
Powered by vBadvanced CMPS v3.1.0

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