Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JVFloatLabeledTextView Can't adjust the placeholderLabel's x position #165

Open
anhpt681995 opened this issue Apr 10, 2017 · 4 comments
Open

Comments

@anhpt681995
Copy link

anhpt681995 commented Apr 10, 2017

Hi,

I wanting to change the text inset of JVFloatLabeledTextView, everything is fine except the placeholderLabel. For content of the UITextView, I just need to adjust the textContainerInset, with floatingLabel, I can see there 2 public APIs is floatingLabelXPadding and floatingLabelYPadding. But with placeholderLabel, it has only one public API is placeholderYPadding.

So I'm wondering how to adjust the placeholderLabel's x position?

@anhpt681995 anhpt681995 changed the title JVFloatLabeledTextView placeholder label can't adjust x padding JVFloatLabeledTextView Can't adjust the placeholderLabel's x position Apr 10, 2017
@jverdi
Copy link
Owner

jverdi commented Apr 11, 2017

Hi - I don't think we currently account for this, or provide a way to customize it.

In JVFloatLabeledTextView.m, in the setLabelOriginForTextAlignment method, I'm thinking we should add self.textContainerInset.left to the x in the first line. (If so, we should add the self.textContainerInset.right to the NSTextAlignmentRight and NSTextAlignmentNatural cases too)

Want to give that a shot?

@anhpt681995
Copy link
Author

anhpt681995 commented Apr 18, 2017

First at all, thanks for your response. However, I think I'll not make the change in the framework's source code. I'm worrying that when JVFloatLabeledTextView release a new version and I update it via CocoaPods, those codes will be lost and my UI will be wrong. So, I'll solve this problem in Interface Builder with some tricks.

Only one thing left, I'm wondering why we can't create a public API for this?

@huntermonk
Copy link

I think he is suggesting forking this repository and making the changes on the actual repo yourself!

Then you can submit the changes to him via GitHub. If it's accepted, when a new version is released, it will include your changes. 👍🏼

@kyam915
Copy link

kyam915 commented Jun 29, 2017

you can adjust it by changing origin.x of JVFloatLabeledTextView.
For example, set floatingLabelXPadding 0, and set origin.x of JVFloatLabeledTextView 16.
This works for me.

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

Successfully merging a pull request may close this issue.

4 participants