summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungkeun Lee <sngn.lee@samsung.com>2017-04-04 16:58:12 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-04-24 13:39:47 +0900
commit5a32fb063068b59dc1262d5ba68352ce2c1d4b48 (patch)
tree08161ad6d681e0a817d6640350e392e1f2e75e80
parent1b3875c4c5677d7ca28671dae3fe635aa2bc8fe8 (diff)
downloadxamarin-forms-5a32fb063068b59dc1262d5ba68352ce2c1d4b48.tar.gz
xamarin-forms-5a32fb063068b59dc1262d5ba68352ce2c1d4b48.tar.bz2
xamarin-forms-5a32fb063068b59dc1262d5ba68352ce2c1d4b48.zip
Fix Label layout issue
- TCAPI-2251 - This issuse was caused by wrong minimum size - Layout class was depend on request size and minium size to layouting If minium size was (0,0) layout will resize to smaller than request size So, Label should be set proper minimum size Change-Id: I895c32d26ca7b090b185f5ff3793638cec6229a2
-rw-r--r--Xamarin.Forms.Platform.Tizen/Native/Label.cs16
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs2
2 files changed, 2 insertions, 16 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Native/Label.cs b/Xamarin.Forms.Platform.Tizen/Native/Label.cs
index a75e6aa8..b81a24e2 100644
--- a/Xamarin.Forms.Platform.Tizen/Native/Label.cs
+++ b/Xamarin.Forms.Platform.Tizen/Native/Label.cs
@@ -312,32 +312,18 @@ namespace Xamarin.Forms.Platform.Tizen.Native
Resize(availableWidth, size.Height);
- var rawSize = Native.TextHelper.GetRawTextBlockSize(this);
var formattedSize = Native.TextHelper.GetFormattedTextBlockSize(this);
Resize(size.Width, size.Height);
// Set bottom padding for lower case letters that have segments below the bottom line of text (g, j, p, q, y).
var verticalPadding = (int)Math.Ceiling(0.05 * FontSize);
- rawSize.Height += verticalPadding;
formattedSize.Height += verticalPadding;
// This is the EFL team's guide.
// For wrap to work properly, the label must be 1 pixel larger than the size of the formatted text.
- rawSize.Width += 1;
formattedSize.Width += 1;
- if (rawSize.Width > availableWidth)
- {
- return new ESize()
- {
- Width = formattedSize.Width,
- Height = Math.Min(formattedSize.Height, Math.Max(rawSize.Height, availableHeight)),
- };
- }
- else
- {
- return formattedSize;
- }
+ return formattedSize;
}
void ApplyTextAndStyle()
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
index 49611e4b..be5de861 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
@@ -44,7 +44,7 @@ namespace Xamarin.Forms.Platform.Tizen
protected override Size MinimumSize()
{
- return new Size(Control.MinimumWidth, Control.MinimumHeight);
+ return Control.Measure(Control.MinimumWidth, Control.MinimumHeight).ToDP();
}
Native.FormattedString ConvertFormattedText(FormattedString formattedString)