Skip to content

Instantly share code, notes, and snippets.

@galvesribeiro
Created May 13, 2016 14:47
Show Gist options
  • Save galvesribeiro/90be9fb9f81d2d5b307d7009848cadae to your computer and use it in GitHub Desktop.
Save galvesribeiro/90be9fb9f81d2d5b307d7009848cadae to your computer and use it in GitHub Desktop.
Dock problem
public class SplashView : BaseWindow
{
public override void Show(Shell target)
{
var bg = new ImageControl();
bg.Texture = "Media/splash.png";
//bg.Size = target.Size;
bg.Dock = DockStyle.Fill;
Controls.Add(bg);
base.Show(target);
}
}
public class BaseWindow : Window
{
public override void Show(Shell target)
{
var label = new Label();
label.Size = new Point(240, 20);
label.Position = new Point(0, 100);
//label.Dock = DockStyle.Center;
label.Style = "footer";
label.Text = $"v1.0.1 Powered by Pay Insights - TI Pagos";
Controls.Add(label);
base.Show(target);
}
}
//aka the Desktop class just renamed
public class AppShell : Shell
{
}
private static Skin GetSkin()
{
var skin = new Skin();
var footStyle = new ControlStyle();
footStyle.TextColor = ColorInt.RGB(255, 0, 0);
footStyle.Font = "20|LaoUI.ttf";
footStyle.TextAlign = Alignment.MiddleCenter;
skin.Add("footer", footStyle);
return skin;
}
@Roderik11
Copy link

I don't see the BaseWindow/Window getting a proper size assigned anywhere :)
Make sure you give your window a good size - then docking should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment