.NET MAUI Preview6 状态预览(7月)
2021年7月更新内容
1.添加多个新功能: 手势、原生警报、弹性布局、裁剪等
- 手势
如下所示, 添加了一个手势, 双击触发一个Command
<Grid>
<Grid.GestureRecognizers>
<TapGestureRecognizer NumberOfTapsRequired="2" Command="{Binding OnTileTapped}" />
</Grid.GestureRecognizers>
<!-- Grid content -->
</Grid>
- 裁剪
例如把图片变成圆形
<Image Source="face.png">
<Image.Clip>
<EllipseGeometry RadiusX="80"
RadiusY="80"
Center="80,80" />
</Image.Clip>
</Image>
- 警告
根据不同平台, 显示提醒的窗口
await DisplayAlert ("Alert", "You have been alerted", "OK");
2.单个项目
- NuGet 包替换为 .NET MAUI 工作负载(在 .csproj 中)。
true - 单个项目解决方案现在将单个平台嵌套在“平台”文件夹中,以实现整洁的组织。
- 更新到 Windows 应用 SDK 0.8.1 RC。 使用市场上最新的 Visual Studio 2022 兼容扩展。
3.基础组件接近完成状态
Preview6 UI组件更新一览
✅ CheckBox
✅ DatePicker
✅ Shapes
✅ Stepper
✅ TimePicker
⚠️ Editor
Preview5
API | Android | iOS / Mac Catalyst | Windows |
---|---|---|---|
AutoSize | ⏳ | ⏳ | ⏳ |
Completed | ✅ | ✅ | ✅ |
CharacterSpacing | ✅ | ✅ | ⏳ |
FontAttributes | ✅ | ✅ | ✅ |
FontFamily | ✅ | ✅ | ✅ |
FontSize | ✅ | ✅ | ✅ |
IsReadOnly | ✅ | ✅ | ⏳ |
IsTextPredictionEnabled | ✅ | ✅ | ⚠️ |
PlaceHolder | ✅ | ✅ | ⚠️ |
PlaceHolderColor | ✅ | ✅ | ⚠️ |
Text | ✅ | ✅ | ⏳ |
TextColor | ✅ | ✅ | ⚠️ |
MaxLength | ✅ | ✅ | ✅ |
Preview6
API | Android | iOS / Mac Catalyst | Windows |
---|---|---|---|
AutoSize | ⏳ | ⏳ | ⏳ |
Completed | ✅ | ✅ | ✅ |
CharacterSpacing | ✅ | ✅ | ✅ |
FontAttributes | ✅ | ✅ | ✅ |
FontFamily | ✅ | ✅ | ✅ |
FontSize | ✅ | ✅ | ✅ |
IsReadOnly | ✅ | ✅ | ✅ |
IsTextPredictionEnabled | ✅ | ✅ | ⏳ |
PlaceHolder | ✅ | ✅ | ✅ |
PlaceHolderColor | ✅ | ✅ | ✅ |
Text | ✅ | ✅ | ✅ |
TextColor | ✅ | ✅ | ✅ |
MaxLength | ✅ | ✅ | ✅ |
⚠️ Entry
Preview5
API | Android | iOS / Mac Catalyst | Windows |
---|---|---|---|
ClearButtonVisibility | ✅ | ✅ | ⏳ |
CharacterSpacing | ✅ | ✅ | ⏳ |
Completed | ⏳ | ⏳ | ⏳ |
CursorPosition | ✅ | ✅ | ⚠️ |
FontAttributes | ✅ | ✅ | ✅ |
FontFamily | ✅ | ✅ | ✅ |
FontSize | ✅ | ✅ | ✅ |
HorizontalTextAlignment | ✅ | ✅ | ⚠️ |
IsTextPredictionEnabled | ✅ | ✅ | ⚠️ |
IsPassword | ✅ | ✅ | ⏳ |
PlaceHolder | ✅ | ✅ | ✅ |
PlaceHolderColor | ⚠️ | ⚠️ | ⚠️ |
VerticalTextAlignment | ⏳ | ⏳ | ⚠️ |
ReturnCommand | ⚠️ | ⚠️ | ⚠️ |
ReturnCommandParameter | ⚠️ | ⚠️ | ⚠️ |
ReturnType | ✅ | ✅ | ⏳ |
SelectionLength | ✅ | ✅ | ⚠️ |
Text | ✅ | ✅ | ✅ |
TextColor | ✅ | ✅ | ✅ |
Preview6
API | Android | iOS / Mac Catalyst | Windows |
---|---|---|---|
ClearButtonVisibility | ✅ | ✅ | ✅ |
CharacterSpacing | ✅ | ✅ | ✅ |
Completed | ✅ | ✅ | ✅ |
CursorPosition | ✅ | ✅ | ⚠️ |
FontAttributes | ✅ | ✅ | ✅ |
FontFamily | ✅ | ✅ | ✅ |
FontSize | ✅ | ✅ | ✅ |
HorizontalTextAlignment | ✅ | ✅ | ⏳ |
IsTextPredictionEnabled | ✅ | ✅ | ⏳ |
IsPassword | ✅ | ✅ | ⏳ |
PlaceHolder | ✅ | ✅ | ✅ |
PlaceHolderColor | ⏳ | ⏳ | ⏳ |
VerticalTextAlignment | ⏳ | ⏳ | ⏳ |
ReturnCommand | ✅ | ✅ | ✅ |
ReturnCommandParameter | ✅ | ✅ | ✅ |
ReturnType | ✅ | ✅ | ✅ |
SelectionLength | ✅ | ✅ | ⚠️ |
Text | ✅ | ✅ | ✅ |
TextColor | ✅ | ✅ | ✅ |
⚠️ Slider
Preview5
API | Android | iOS / Mac Catalyst | Windows |
---|---|---|---|
DragCompleted | ✅ | ✅ | ✅ |
DragCompletedCommand | ✅ | ✅ | ✅ |
DragStarted | ✅ | ✅ | ✅ |
DragStartedCommand | ✅ | ✅ | ✅ |
Maximum | ✅ | ✅ | ✅ |
MaximumTrackColor | ✅ | ✅ | ✅ |
Minimum | ✅ | ✅ | ✅ |
MinimumTrackColor | ✅ | ✅ | ✅ |
ThumbColor | ✅ | ✅ | ⏳ |
ThumbImageSource | ⏳ | ⏳ | ⏳ |
Value | ✅ | ✅ | ✅ |
ValueChanged | ✅ | ✅ | ✅ |
Preview6
API | Android | iOS / Mac Catalyst | Windows |
---|---|---|---|
DragCompleted | ✅ | ✅ | ✅ |
DragCompletedCommand | ✅ | ✅ | ✅ |
DragStarted | ✅ | ✅ | ✅ |
DragStartedCommand | ✅ | ✅ | ✅ |
Maximum | ✅ | ✅ | ✅ |
MaximumTrackColor | ✅ | ✅ | ✅ |
Minimum | ✅ | ✅ | ✅ |
MinimumTrackColor | ✅ | ✅ | ✅ |
ThumbColor | ✅ | ✅ | ⏳ |
ThumbImageSource | ⏳ | ⏳ | ✅ |
Value | ✅ | ✅ | ✅ |
ValueChanged | ✅ | ✅ | ✅ |
⚠️ Switch
Preview6
API | Android | iOS / Mac Catalyst | Windows |
---|---|---|---|
IsToggled | ✅ | ✅ | ✅ |
OnColor | ✅ | ✅ | ⏳ |
ThumbColor | ✅ | ✅ | ⏳ |
⚠️ WebView
Preview6
API | Android | iOS / Mac Catalyst | Windows |
---|---|---|---|
CanGoBack | ⚠️ | ⚠️ | ⚠️ |
CanGoForward | ⚠️ | ⚠️ | ⚠️ |
Cookies | ⚠️ | ⚠️ | ⚠️ |
Source | ⏳ | ⏳ | ⏳ |
Eval | ⚠️ | ⚠️ | ⚠️ |
EvaluateJavaScriptAsync | ⚠️ | ⚠️ | ⚠️ |
GoBack | ⚠️ | ⚠️ | ⚠️ |
GoForward | ⚠️ | ⚠️ | ⚠️ |
Reload | ⚠️ | ⚠️ | ⚠️ |
Renderer Based Views
Preview6
View | Android | iOS / Mac Catalyst | Windows |
---|---|---|---|
CarouselView | ✅ | ✅ | ⚠️ |
CollectionView | ✅ | ✅ | ⚠️ |
IndicatorView | ⏳ | ✅ | ⚠️ |
ImageButton | ✅ | ✅ | ✅ |
Map | ⏳ | ⏳ | ⚠️ |
RefreshView | ⚠️ | ⚠️ | ⚠️ |
SwipeView | ✅ | ✅ | ⚠️ |
Layouts
Preview6
Layout | Android | iOS / Mac Catalyst | Windows |
---|---|---|---|
AbsoluteLayout | ✅ | ✅ | ✅ |
ContentPresenter | ⚠️ | ⚠️ | ⚠️ |
ContentView | ⚠️ | ⚠️ | ⚠️ |
FlexLayout | ✅ | ✅ | ✅ |
Grid | ✅ | ✅ | ✅ |
RelativeLayout | ✅ | ✅ | ✅ |
ScrollView | ✅ | ✅ | ✅ |
StackLayout | ✅ | ✅ | ✅ |
TemplatedView | ⚠️ | ⚠️ | ⚠️ |
Features
Preview6
Feature | Android | iOS / Mac Catalyst | Windows |
---|---|---|---|
Accessibility | ✅ | ✅ | ✅ |
Animation | ✅ | ✅ | ✅ |
Border Everywhere | ⏳ | ⏳ | ⏳ |
Brushes Everywhere | ✅ | ✅ | ✅ |
CornerRadius Everywhere | ⏳ | ⏳ | ⏳ |
Device | ⚠️ | ⚠️ | ⚠️ |
Gestures | ✅ | ✅ | ✅ |
ImageHandlers | ✅ | ✅ | ✅ |
Interactivity (Behaviors, Triggers, Visual State Manager) | ✅ | ✅ | ✅ |
FlowDirection (RTL) | ⏳ | ⏳ | ⏳ |
Fonts | ✅ | ✅ | ✅ |
Lifecycle Events | ⏳ | ⏳ | ⏳ |
Themes | ⏳ | ⏳ | ⚠️ |
Shell | ⏳ | ⏳ | ⏳ |
Styles | ✅ | ✅ | ✅ |
View Transforms | ✅ | ✅ | ✅ |