XF 绝对布局
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
[assembly: XamlCompilation (XamlCompilationOptions.Compile)]
namespace App7
{
public partial class App : Application
{
public App ()
{
InitializeComponent();
var green = new Label { Text = "Green Color", FontSize = 20, TextColor = Color.Black, BackgroundColor=Color.Green, WidthRequest = 200, HeightRequest = 50 };
var pink = new Label { Text = "Pink Color", FontSize = 20, TextColor = Color.Black, BackgroundColor=Color.Pink, WidthRequest = 200, HeightRequest = 50 };
var yellow = new Label { Text = "Yellow Color", FontSize = 20, TextColor = Color.Black,BackgroundColor=Color.Yellow, WidthRequest = 200, HeightRequest = 50 };
var absLayout = new AbsoluteLayout();
absLayout.Children.Add(green, new Point(80, 100));
absLayout.Children.Add(pink, new Point(80, 160));
absLayout.Children.Add(yellow, new Point(100, 370));
MainPage = new ContentPage { Content=absLayout};
}
protected override void OnStart ()
{
// Handle when your app starts
}
protected override void OnSleep ()
{
// Handle when your app sleeps
}
protected override void OnResume ()
{
// Handle when your app resumes
}
}
}