summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS
diff options
context:
space:
mode:
authorSamantha Houts <samantha@teamredwall.com>2017-01-12 19:48:30 (GMT)
committerJason Smith <jason.smith@xamarin.com>2017-01-12 19:48:30 (GMT)
commit3af99cbbe145a876cc9839af0adead83695b5445 (patch)
treea94639d66151591abac7ecc356cf947e12c8f4a2 /Xamarin.Forms.Platform.iOS
parente7a7a57e4b2f7db71137e702be2663cf4f37d1b4 (diff)
downloadxamarin-forms-3af99cbbe145a876cc9839af0adead83695b5445.zip
xamarin-forms-3af99cbbe145a876cc9839af0adead83695b5445.tar.gz
xamarin-forms-3af99cbbe145a876cc9839af0adead83695b5445.tar.bz2
[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.cs4
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 0a9ef79..58312f8 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);
}