Skip to content

Fix text view sizing when using custom fonts#305

Open
SebastianThiebaud wants to merge 7 commits intonicklockwood:masterfrom
quri:master
Open

Fix text view sizing when using custom fonts#305
SebastianThiebaud wants to merge 7 commits intonicklockwood:masterfrom
quri:master

Conversation

@SebastianThiebaud
Copy link
Copy Markdown

Problem:

Right now, when we use a custom font for the -[FXFormTextViewCell textView] the height isn't right.
+ (CGFloat)heightForField:(FXFormField *)field width:(CGFloat)width is initializing a static UITextView object with [UIFont systemFontOfSize:17]; value for the font property.

Solution:

An easy way to solve that issue is adding a class method that could be override by a subclass.
+ (UITextView *)textViewForSizing is returning a custom UITextView that can be used by the sizing method.
But + (CGFloat)heightForField:(FXFormField *)field width:(CGFloat)width needs to resign its dispatch_once block. The static UITextView object would make useless a subclass override of + (UITextView *)textViewForSizing. This last method is now responsible of the dispatch_once block. For this reason, it would might be clever to update the documentation and ask any developers integrating that feature to be sure to take care of that GCD block for performance reasons.

Seb C. Thiebaud and others added 6 commits February 9, 2015 16:44
@markst
Copy link
Copy Markdown

markst commented Apr 15, 2015

+1

@SebastianThiebaud
Copy link
Copy Markdown
Author

Would be nice to review that PR. We are still using our fork because the official one isn't supporting that.

@abbasmousavi
Copy link
Copy Markdown

+1, please review and merge this.

abbasmousavi added a commit to abbasmousavi/FXForms that referenced this pull request Feb 14, 2016
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

Successfully merging this pull request may close these issues.

4 participants