This commit is contained in:
David Britch 2024-10-29 10:27:25 +00:00 коммит произвёл GitHub
Родитель c86e8c32a4
Коммит 859d1aae97
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -1,7 +1,7 @@
---
title: "Button"
description: "The .NET MAUI Button displays text and responds to a tap or click that directs an app to carry out a task."
ms.date: 08/30/2024
ms.date: 10/29/2024
---
# Button
@ -344,6 +344,9 @@ Button button = new Button
};
```
> [!NOTE]
> If a <xref:Microsoft.Maui.Controls.Button> contains text and an image it might not be possible to fit all the content inside the button, and so you should size your image manually to achieve your desired layout.
## Disable a Button
Sometimes an app enters a state where a <xref:Microsoft.Maui.Controls.Button> click is not a valid operation. In such cases, the <xref:Microsoft.Maui.Controls.Button> can be disabled by setting its `IsEnabled` property to `false`.

Просмотреть файл

@ -161,6 +161,10 @@ AppContext.SetSwitch("BlazorWebView.AndroidFireAndForgetAsync", true);
This switch enables <xref:Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView> to fire and forget the async disposal that occurs, and as a result fixes the majority of the disposal deadlocks that occur on Android. For more information, see [Fix disposal deadlocks on Android](~/user-interface/controls/blazorwebview.md#fix-disposal-deadlocks-on-android).
### Buttons on iOS
<xref:Microsoft.Maui.Controls.Button> controls on iOS now respect spacing, padding, border width, and margins more accurately than in previous releases. A large image in a <xref:Microsoft.Maui.Controls.Button> will now be resized to the maximum size, taking into account the spacing, padding, border width, and margins. However, if a <xref:Microsoft.Maui.Controls.Button> contains text and an image it might not be possible to fit all the content inside the button, and so you should size your image manually to achieve your desired layout.
### CollectionView and CarouselView
.NET MAUI 9 includes two optional new handlers on iOS and Mac Catalyst that bring performance and stability improvements to `CollectionView` and `CarouselView`. These handlers are based on `UICollectionView` APIs.