forked from xmartlabs/Eureka
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FieldRow.titlePercentage instead of FieldRow.textFieldPercentage (xma…
…rtlabs#965). Properly calculate FieldRow constraints. * Deprecate FieldRowConformance.textFieldPercentage in favor of FieldRowConformance.titleLabelPercentage in order to fix alignment issues when using an accessory view/type on a FieldCell * Include optional imageView in title width calculations. Only works for right-to-left languages in iOS 9.0 and higher since only app extension API is allowed. This prohibits determining of interface layout direction in older iOS versions. * Rename titleLabelPercentage to titlePercentage as it should not only encompass the titleLabel’s width but also an optional imageView’s width. Also maintain a private calculatedTitlePercentage property instead of caching and resetting the row’s value after each constraint update. If `titleFieldPercentage` is not set, the layout is not adjusted to make up for potential accessory and/or image views. Instead a fixed constant is used for the respective constraint. By moving this fixed constant to the advanced layout calculation we not only solve the aforementioned issue but also eliminate duplication of the the constant during constraint setup. Note that this could have also been achieved by simply declaring `titleFieldPercentage` a non-optional variable and assigning a default value of 0.3. Since this would represent both a code breaking as well as somewhat of a semantic change the solution at hand was deemed preferable
- Loading branch information
Showing
1 changed file
with
64 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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