使用 CSS,您可以設定border-left-width、border-right-width等以獲取邊框上的單獨寬度。
在 .NET MAUI 中是否可以實作等價物,如果可以,您是如何做到的?
我知道Border元素,但它只有一個StrokeWidth.
uj5u.com熱心網友回復:
邊框元素無法做到這一點,因為它旨在渲染筆觸,可能帶有圓角和破折號。
ContentView與BackgroundColor和一起使用Padding。
這是 Maui dotnet 機器人,每邊都有不同的厚度填充(邊框):
<ContentView BackgroundColor="Gray">
<ContentView BackgroundColor="HotPink" Padding="1,2,3,4" VerticalOptions="Center" HorizontalOptions="Center">
<VerticalStackLayout BackgroundColor="LightPink" Spacing="25" Padding="30,0" VerticalOptions="Center" HorizontalOptions="Center">
<Image Source="dotnet_bot.png" HeightRequest="100" HorizontalOptions="Center" />
<Button x:Name="CounterBtn" Text="Click me" SemanticProperties.Hint="Counts the number of times you click" Clicked="OnCounterClicked" HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentView>
</ContentView>
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/482246.html
下一篇:圖示未出現在彈出式MAUI中
