Fix text view sizing when using custom fonts#305
Open
SebastianThiebaud wants to merge 7 commits intonicklockwood:masterfrom
Open
Fix text view sizing when using custom fonts#305SebastianThiebaud wants to merge 7 commits intonicklockwood:masterfrom
SebastianThiebaud wants to merge 7 commits intonicklockwood:masterfrom
Conversation
Add class method to FXFormTextViewCell
FXFormTextViewCell calls UITableView beginUpdates only if its height cha...
FXFormTextViewCell redundant resize calls
12b6653 to
47c940f
Compare
|
+1 |
Author
|
Would be nice to review that PR. We are still using our fork because the official one isn't supporting that. |
|
+1, please review and merge this. |
abbasmousavi
added a commit
to abbasmousavi/FXForms
that referenced
this pull request
Feb 14, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
Right now, when we use a custom font for the
-[FXFormTextViewCell textView]the height isn't right.+ (CGFloat)heightForField:(FXFormField *)field width:(CGFloat)widthis initializing a staticUITextViewobject with[UIFont systemFontOfSize:17];value for thefontproperty.Solution:
An easy way to solve that issue is adding a class method that could be override by a subclass.
+ (UITextView *)textViewForSizingis returning a customUITextViewthat can be used by the sizing method.But
+ (CGFloat)heightForField:(FXFormField *)field width:(CGFloat)widthneeds to resign itsdispatch_onceblock. The static UITextView object would make useless a subclass override of+ (UITextView *)textViewForSizing. This last method is now responsible of thedispatch_onceblock. 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.