diff options
author | Samantha Houts <samantha@teamredwall.com> | 2017-01-12 11:48:30 -0800 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2017-01-12 11:48:30 -0800 |
commit | 3af99cbbe145a876cc9839af0adead83695b5445 (patch) | |
tree | a94639d66151591abac7ecc356cf947e12c8f4a2 /Xamarin.Forms.Platform.iOS | |
parent | e7a7a57e4b2f7db71137e702be2663cf4f37d1b4 (diff) | |
download | xamarin-forms-3af99cbbe145a876cc9839af0adead83695b5445.tar.gz xamarin-forms-3af99cbbe145a876cc9839af0adead83695b5445.tar.bz2 xamarin-forms-3af99cbbe145a876cc9839af0adead83695b5445.zip |
[iOS] Labels with WordWrap or CharacterWrap will Expand (#529)
* Add reproduction for 28650
* [iOS] Expand the label to fill width if wrapping
Also, simplify the `if` statement, since `LineBreakMode` is not a flags
enum and the only excluded member was `None`.
* Test two small labels next to each other in horizontal layout
Diffstat (limited to 'Xamarin.Forms.Platform.iOS')
-rw-r--r-- | Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs index 0a9ef79a..58312f8a 100644 --- a/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs @@ -26,9 +26,9 @@ namespace Xamarin.Forms.Platform.iOS var result = base.GetDesiredSize(widthConstraint, heightConstraint); result.Minimum = new Size(Math.Min(10, result.Request.Width), result.Request.Height); - if ((Element.LineBreakMode & (LineBreakMode.TailTruncation | LineBreakMode.HeadTruncation | LineBreakMode.MiddleTruncation)) != 0) + if (Element.LineBreakMode != LineBreakMode.NoWrap) { - if (result.Request.Width > widthConstraint) + if (result.Request.Width > widthConstraint || Element.LineBreakMode == LineBreakMode.WordWrap || Element.LineBreakMode == LineBreakMode.CharacterWrap) result.Request = new Size(Math.Max(result.Minimum.Width, widthConstraint), result.Request.Height); } |