我在 Figma 中繪制了一個框架并嘗試以 xamarin 形式實作它,但我無法在不同的設備尺寸上對其進行縮放。我嘗試在不使用的情況下調整它的大小,Aspect="Uniform"但它不起作用。
- Figma 框架我在 Figma 中使用了 Iphone 框架來繪制形狀。
- Xaml 設計我將形狀的路徑從 Figma 復制到 xaml。
<?xml version="1.0" encoding="UTF-8" ?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Mobile.WelcomePage">
<ContentPage.Content>
<Grid>
<Path Aspect="Uniform" Data="M51.25 307C51.25 309.12 52.2277 311.013 53.757 312.25H25C11.6071 312.25 0.75 301.393 0.75 288V25C0.75 11.6071 11.6071 0.75 25 0.75H359C372.393 0.75 383.25 11.6071 383.25 25V288C383.25 301.393 372.393 312.25 359 312.25H330.243C331.772 311.013 332.75 309.12 332.75 307V263.107C332.75 259.379 329.728 256.357 326 256.357H58C54.2721 256.357 51.25 259.379 51.25 263.107V307Z" Fill="#1098FC" Stroke="1.5"/>
</Grid>
</ContentPage.Content>
</ContentPage>
- iPhone 7 結果在下圖中,形狀超出了螢屏尺寸
- Iphone 13 結果在 iPhone 13 上它很好,但我無法調整它的大小
uj5u.com熱心網友回復:
Aspect="Uniform"應該可以作業,并且根據我的測驗它實際上可以正常作業。

我建議您將Xamarin.Forms軟體包更新到最新版本,然后重試。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/437765.html
標籤:xml xamarin xamarin.forms figma
