namespace Pages;
public partial class Page : ContentPage
{
#if ANDROID
protected override bool OnBackButtonPressed() => true; //取消 Android 返回鍵
#endif
protected override void OnAppearing() //頁面初始化
{
base.OnAppearing();
}
protected override void OnSizeAllocated(double width, double height) //當它的寬度和高度確定下來時,.NET MAUI 的佈局系統會呼叫這個方法。
{
base.OnSizeAllocated(width, height);
var Block_Button_AbsoluteLayout = AbsoluteLayout.GetLayoutBounds(this.Block_Button);
var _New_Main_Height = this.Height - Block_Button_AbsoluteLayout.Height;
var _New_Main_Flags = AbsoluteLayoutFlags.XProportional | AbsoluteLayoutFlags.YProportional | AbsoluteLayoutFlags.WidthProportional;
AbsoluteLayout.SetLayoutBounds(this.Block_Main, new Rect(0, 0, 1, _New_Main_Height));
AbsoluteLayout.SetLayoutFlags(this.Block_Main, _New_Main_Flags);
}
public Page()
{
InitializeComponent();
}
#region Function
#endregion
}