Plugin.Maui.ZoomView is a .NET MAUI plugin that provides a customizable zoomable view for cross-platform applications. It allows developers to easily integrate zooming functionality into their applications, supporting Android and iOS platforms.
Platform | Status |
---|---|
🤖 Android | ✅ Supported |
🍎 iOS | ✅ Supported |
The ZoomView
control exposes the following bindable properties:
Property | Type | Default | Description |
---|---|---|---|
Content |
View |
null |
The content to be displayed inside the zoomable area. |
ZoomInOnDoubleTap |
bool |
true |
If true , a double-tap will zoom in when the zoom level is at default. |
ZoomOutOnDoubleTap |
bool |
true |
If true , a double-tap will reset zoom when already zoomed in. |
Method | Description |
---|---|
Reset() |
Resets the zoom and position to the initial state. |
-
Add the
Plugin.Maui.ZoomView
package to your .NET MAUI project. You can do this via NuGet Package Manager or by running the following command:dotnet add package Plugin.Maui.ZoomView
-
Ensure your project is set up for .NET MAUI and includes the necessary platform-specific configurations.
-
After installing the package, call the
UseZoomView()
method in theMauiProgram.cs
file of your project to initialize the plugin:public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder .UseMauiApp<App>() .UseZoomView(); // Add this line return builder.Build(); }
- Add the
ZoomView
control to your XAML file:<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:zoomview="clr-namespace:Plugin.Maui.ZoomView;assembly=Plugin.Maui.ZoomView" x:Class="YourNamespace.MainPage"> <zoomview:ZoomView> <!-- Add your content here --> </zoomview:ZoomView> </ContentPage>
⚠️ Note:
ZoomView
is best suited for non-interactive content likeImage
,Label
, or static custom views. While interactive controls (e.g.,Entry
,Editor
,Button
) can be placed inside, they may not behave reliably during zoom or pan. Use with caution.
🤝 Contributions are welcome! If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
📜 This project is licensed under the MIT License. See the LICENSE file for details.