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

Field does not work correctly with size classes or autolayout #34

Open
phongleq opened this issue Nov 12, 2014 · 2 comments
Open

Field does not work correctly with size classes or autolayout #34

phongleq opened this issue Nov 12, 2014 · 2 comments

Comments

@phongleq
Copy link

So I have the token field span the whole width of the view with (any,any). The constraints are 0 on both sides. Visually this looks fine but once you tap on it to type the text fields expands to the side which it was originally. In my case with (any,any) view on the storyboard is 600.

So initially the view would be laid out correctly but once tapped on to type it expands the field to 600.

@sevy11
Copy link

sevy11 commented Nov 4, 2016

@phongleq did you ever sort this out, Im having the same issue currently?

@mttirnavali
Copy link

if you want to use VENTokenField with auto-layout, you can define:

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *tokenFieldHeightConstraint;

and assign it with tokenFieldHeight in StoryBoard, then on delegates:

-(void)tokenField:(VENTokenField *)tokenField didChangeText:(NSString *)text { self.tokenFieldHeightConstraint.constant = tokenField.frame.size.height; }

-(void)tokenField:(VENTokenField *)tokenField didEnterText:(NSString *)text { self.tokenFieldHeightConstraint.constant = tokenField.frame.size.height; }

-(void)tokenField:(VENTokenField *)tokenField didDeleteTokenAtIndex:(NSUInteger)index { self.tokenFieldHeightConstraint.constant = tokenField.frame.size.height; }

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

No branches or pull requests

3 participants