Resizing the screen when an Entry gets focused in .NET MAUI

When an entry field gets focused, the software keyboard appears, potentially covering the entry field. To provide a better user experience, you need to adjust the screen layout so that the entry field remains visible. First, create a parent class for your views, deriving from ContentPage, and add a HaveKeyboardOffsetProperty. iOS Solution: Next, create the PageElementMapper class to handle the keyboard appearance and adjust the screen layout. Finally, register the mapper in the MauiProgram.cs file. Android solution: On Android, you can use a PropertyChanged method of the HasKeyboardOffset: Remarks The provided solution offers a way to manage this in .NET MAUI on iOS. However, always be open to improvements and share your solutions with the community for better practices. This might not be the best solution to do it.

.NET MAUI Hide software keyboard when tapping out of an Entry on iOS

To hide the software keyboard when the user taps outside the entry field, set the HideSoftInputOnTapped property to True in your ContentPage definition. Please note that the HideSoftInputOnTapped property might not work as expected when tapping on certain controls like ScrollView. In such cases, you might need to implement a custom behavior to handle keyboard dismissal.

Using Different Entitlements for Debug and Release Modes in .NET MAUI – iOS

When developing a mobile app using .NET MAUI, particularly for iOS, it’s essential to configure your application differently for debug and release modes. One of these differences is the APS-environment setting, which dictates how your app communicates with Apple Push Notification services (APNs) during development and production. What is Entitlements.plist? The Entitlements.plist is a property list (plist) file that defines various capabilities or entitlements for your app. Entitlements are special permissions that allow your app to use certain services provided by iOS, such as iCloud, In-App Purchases, or push notifications. For push notifications, the Entitlements.plist file contains the APS-environment key, which indicates to Apple whether your app is in development or production mode. Based on this, the app uses either the sandbox or production APNs. What is APS-environment? The APS-environment (Apple Push Services environment) is an entitlement used to specify the environment for push notifications. This entitlement informs Apple’s servers whether the app is running in a development environment or in production, determining which server to send the notifications through: This configuration helps separate testing from live user interactions and avoids accidental notification delivery to users during testing. Configuring Different APS-environments for Debug and Release To configure different environments for Debug and Release modes in your .NET MAUI project, you can modify your .csproj file as follows: It’s important to ensure that both Entitlements.plist and Entitlements-Production.plist files are not included in the build by accident. This can be achieved by setting their Build Action to None: This step ensures that the files are correctly associated with your app for code-signing purposes but are not compiled into the app bundle…

Azure Pipelines error after macOS / iOS update when building iOS apps with .NET MAUI

If you are facing problems after a new version of macOS, or iOS have been released, stay tuned. In this example, I’m having issues with the new update of iOS 18 and macOS Sequioa. Some days or weeks are needed from Microsoft side to have a vmPool in the cloud to build your iOS apps with the latest SDKs, so theres a possibility that you might encounter this problem on some fresher updates aswell. So how the error looks like? Solution after the proper vmImages are released by Microsoft: To resolve this issue, you need to update the macOS image used in your Azure Pipelines to the latest version. This ensures that the build environment uses the most recent version of Xcode, which includes the necessary iOS SDKs. Here’s how you can update your Azure Pipelines configuration: By updating the vmImage to macOS-latest, you ensure that your build environment is using the latest tools and SDKs, which should resolve the linker errors related to unavailable types. Solution until the proper vmImages are not present: Modify your pipeline, and don’t forget to add comments on the modified pipeline!

.NET MAUI iOS – Can’t launch the app, crashes on splash screen error

This content has 7 months. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.If you are facing issues launching your iOS application in VS Code, then try to analyse the Debug Console of your application.If you see things like this: And then your application suddenly crashes showing the splashscreen, then the debugger might be slow. XCode 15 have problems with debugging. If you have “Connect via network” enabled on your XCode settings under Devices and Simulators, than this might be the problem. Even if you are connecting your phone wired, it starts the application debugging via wifi. Try updating XCode to 15.4, and update your OS to macOS Sonoma 15.4 aswell You can countercheck this problem by disabling the wifi on your physical device. In this case the app installs, but crashes instantly when trying to launch it. Additionally in Visual Studio code the solution you can disable some settings in the C# extension’s settings the Debug > Logging to speed up the loading progress when launching your app.