Frame 重要屬性
屬性 | 型態 | 說明 |
BorderColor | Color | 框線顏色 |
CornerRadius | Float | 角落圓角半徑 |
HasShadow | Bool | 框架是否有陰影 |
官方文章內的 HasShadow 說明
The HasShadow property behavior is platform-dependent. The default value is true on all platforms. However, on UWP drop shadows are not rendered. Drop shadows are rendered on both Android and iOS but drop shadows on iOS are darker and occupy more space.很簡易地呈現一下效果
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="FrameDemo.MainPage">
<StackLayout Padding="10">
<Frame>
<Label Text = "Frame - 預設" FontSize = "Large"/>
</Frame>
<Frame BackgroundColor="LightGray"
BorderColor="Orange"
CornerRadius="10"
HasShadow="True">
<Label Text="Frame - 圓角、陰影" FontSize="Large"/>
</Frame>
</StackLayout>
</ContentPage>
- 參考資料
- Xamarin.Forms Frame