由于 .NET MAUI 是 Xamarin 的繼承者,我正在嘗試將 Xamarin 布局移植到新的 Maui 版本。RelativeLayout已從毛伊島移除。我使用 將RelativeLayoutGUI 放置在影像之上。此影像是全屏背景影像,在長度上拉伸,保持其比例。
我可以創建相同的布局,但在背景中使用 100% 高度并保持其比例的全屏影像。我將如何在 .NET Maui 中執行此操作?它不是關于如何使影像拉伸,而是將布局元素(如條目、標簽等)放在影像頂部。
uj5u.com熱心網友回復:
使用網格的示例:
<!-- single cell grid filling its parent. -->
<Grid>
<!-- both children default to cell (0,0). Overlaid. -->
<Image Aspect="AspectFit" ... />
<!-- nested grid. OR StackLayout, etc. -->
<Grid ... >
<!-- GUI content here. -->
</Grid>
</Grid>
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/506305.html
上一篇:Winui3,無法切換字體
