Give the editor a default size

This commit is contained in:
Frank A. Krueger 2017-12-09 23:22:39 -08:00
parent 85c7c74270
commit 11d9e1c2fb
2 changed files with 10 additions and 2 deletions

View File

@ -10,6 +10,12 @@ namespace Ooui.Forms.Renderers
bool _disposed;
IEditorController ElementController => Element;
public override SizeRequest GetDesiredSize (double widthConstraint, double heightConstraint)
{
var size = new Size (160, 100);
return new SizeRequest (size, size);
}
protected override void Dispose (bool disposing)
{
if (_disposed)

View File

@ -5,7 +5,7 @@ namespace Samples
{
public class EditorSample : ISample
{
public string Title => "Editor Sample";
public string Title => "Xamarin.Forms Editor Sample";
public Ooui.Element CreateElement()
{
@ -13,7 +13,9 @@ namespace Samples
var titleLabel = new Xamarin.Forms.Label
{
Text = "Editor"
Text = "Editor",
FontSize = 24,
FontAttributes = FontAttributes.Bold,
};
panel.Children.Add(titleLabel);