Making Picker Popup (custom date picker)

Discussion in 'iOS Programming' started by loon3y, Oct 26, 2011.

  1. loon3y macrumors 65816

    loon3y

    Joined:
    Oct 21, 2011
    #1
    how do i make a picker pop up from a textfield?



    I'm using the regular picker (not date picker), as I'm customizing it to show percentages on one textfield and to implement that percentage automatically to the next textfield which is the final charge amount.


    can anyone help?
     
  2. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    When you click on a text Field (but i'd rather not make it an textfield, since it's gonna be filled up with an picker..), you have delegate methods of UITextField -> which is UITextFieldDelegate.
    There you can say, if starts editing, in that method you can do this ->
    - Create a picker view in IB.
    - Present picker in a Popover
    - tadaaaa
     
  3. loon3y thread starter macrumors 65816

    loon3y

    Joined:
    Oct 21, 2011
    #4
    I've been told to create a separate UIView that contains my picker view and to put a border on it so it looks like a popup/alert. and than add it to my main view and make it invisible, and have the touch action set view to visible when a user clicks on the text field



    but i particularly don't know how to do this, a bit complex for an amateur.
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    So, you haven't tried anything yet? If so, what help (be specific) are you expecting from us?

    What are you doing / using to learn the fundamentals of iOS Development? If you're using books, what are they (names, editions, authors)? If online tutorials, provide links. Something else? Please elaborate. Remember, be specific.
     
  5. loon3y thread starter macrumors 65816

    loon3y

    Joined:
    Oct 21, 2011
    #6
    I've only read the book iPad iOS 4 Development Essentials - Xcode 4 Edition by Neil Smith.



    i need to know how to make the pickerview into a popup from the textfield, can u guys tell me how to code it?


    how do i code the touch action part when u touch the text field to the picker view pop up, and how do i connect the secondary UIView (where the picker view popup is going to be) with the first UIView that has all my text fields, and how do i make it invisible till u touch the textfield?
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #7
    Apparently Chapter 18 of that book covers "Using the UIPickerView and UIDatePicker Components in iOS 4 iPad Applications" and Chapter 19 is about "An iOS 4 iPad UIPickerView Example". Since I don't have the book itself, I don't know the details of those chapters, but sounds like they might cover at least half of the issue you're trying to solve. As for the other half, does that book cover UITextFieldDelegate methods?
     
  7. loon3y thread starter macrumors 65816

    loon3y

    Joined:
    Oct 21, 2011
    #8



    the tutorial and examples were very simple, didn't cover what i needed. and no they did not go over the textfield delegate methods.


    i can make the picker i just need to know how to make it a pop up/hidden till i press the textfield and link it.
     

Share This Page