EntryElement UITextField position miscalculated #178
+24
−24
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.
When testing an app that uses an EntryElement on an Ad-Hoc configuration (couldn't reproduce it in Debug), after a while (usually the 2nd or 3rd time loading a dialog) the static UIFont that is used to calculate the EntryAligment returns a font of size 0. So it messes up all the calculations for the ComputeEntryPosition method.
Using a local UIFont var fixes the problem.
I think this could be a problem of the mono compiler, but at least this patch fixes the issue for MT.D.
Hope it helps!
PS. system info below
Xamarin Studio
Version 4.0.3 (build 13)
Installation UUID: 675af92b-4382-4a2c-aeb5-2718b3d00757
Runtime:
Mono 3.0.7 (master/514fcd7)
GTK 2.24.16
GTK# (2.12.0.0)
Package version: 300070000
Apple Developer Tools
Xcode 4.6.1 (2067)
Build 4H512
Xamarin.iOS
Version: 6.3.2.0 (Indie Edition)
Hash: 56e611b
Branch:
Build date: 2013-25-03 21:37:44-0400