Skip to content

How to setup placeholder label at the center of textfield not at the bottom .  #19

Open

Description

@iOSDevAkshay

Need to set placeholder at the center of UITextfield . someone please help with this .

Activity

  1. stephsharp commented on Jun 24, 2018

    @stephsharp
    Owner

    Hi @iOSDevAkshay, I'd be happy to help.

    You can use textPadding like this to add extra space above and below the text field, and it will be centered vertically:

    myTextField.textPadding = CGSizeMake(0.0f, 8.0f);
    

    Or are you looking for something like this (horizontally centered)?

    screen shot 2018-06-24 at 5 02 57 pm

    If you center the text, the placeholder will also be centered:

    screen shot 2018-06-24 at 5 04 35 pm

  2. iOSDevAkshay commented on Jun 26, 2018

    @iOSDevAkshay
    Author

    I am looking for placeholder and active placeholder at center , please help ..
    screen shot 2018-06-26 at 12 31 52 pm
    In my case placeholder goes to left . when activated . I have already set alignment at center .

  3. stephsharp commented on Jul 15, 2018

    @stephsharp
    Owner

    @iOSDevAkshay, I've just released an update so please try v1.0.1 and let me know if you're still seeing the placeholder on the left when the text is centered. If you're able to provide screenshots and/or a link to your code, that would be helpful.

  4. Jignesh1805 commented on Aug 3, 2018

    @Jignesh1805

    placeholder not see please help me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions