In Xamairin the Editor component doesn’t have a border on iOS. If you want to add one in the iOS project just added the following code. using UIKit; using WordBankEasy.iOS.Renderers; using Xamarin.Forms; using Xamarin.Forms.Platform.iOS; [assembly: ExportRenderer(typeof(Editor), typeof(CustomEditorRenderer))] namespace PSC.iOS.Renderers { public class CustomEditorRenderer : EditorRenderer { protected override void OnElementChanged( ElementChangedEventArgs<Editor> e) { base.OnElementChanged(e); if(Control != null) { Control.Layer.BorderColor = UIColor.FromRGB(204, 204, 204).CGColor; Control.Layer.BorderWidth = 0.5f; Control.Layer.CornerRadius = 3f; } } } } Happy coding!
Search Results for: xamarin
Preserve data when deploying Xamarin.Android app
By default all your data from your previous runs is deleted when you’re deploying an Xamarin.Android app. In many cases you don’t want the data to be deleted. Visual Studio To preserve data go to Tools -> Options -> Xamarin -> Android Settings and check “Preserve application data/cache on device between deploys”. Xamarin Studio To preserve data go to Tools -> Options -> Android and check “Preserve data/cache between application deploys”. Happy coding!
“System.IO.FileNotFoundException” using controls from another assembly in Xamarin Forms on iOS.
I was building a Xamarin solution with my components like that: All my components (PSC.Xamarin.Controls.*) are working fine in other solutions.Always fine for Windows or UWP solutions. A problem was born when I started to deployed my solutions on iOS. When on the app I opened a page with my controls I always received an error like: System.IO.FileNotFoundException: Could not load file or assembly ‘PSC.Xamarin.Controls.BindablePicker’ or one of its dependencies. The system cannot find the file specified. I can check my references and deployment settings in all ways, it turns…
What is the difference between Xamarin.Form’s layout options?
In Xamarin.Forms every View has the two properties HorizontalOptions and VerticalOptions. Both are of type LayoutOptions and can have one of the following values: LayoutOptions.Start LayoutOptions.Center LayoutOptions.End LayoutOptions.Fill LayoutOptions.StartAndExpand LayoutOptions.CenterAndExpand LayoutOptions.EndAndExpand LayoutOptions.FillAndExpand Apparently it controls the view’s alignment on the parent view. But how exactly is the behavior of each individual option? And what is the difference between Fill and the suffix Expand? Theory The structure LayoutOptions controls two distinct behaviors: Alignment: How is the view aligned within the parent view? Start: For vertical alignment the view is moved to…
Custom ContextAction with Xamarin Forms
I using a Xamarin Forms ListView and I want to enable or disable the Context Actions based on a certain binding or in the code behind. The way I found is to use BindingContextChanged in a ViewCell. I show you an example <?xml version=”1.0″ encoding=”utf-8″ ?> <ContentPage xmlns=”https://xamarin.com/schemas/2014/forms” xmlns:x=”https://schemas.microsoft.com/winfx/2009/xaml”> <ContentPage.Content> <StackLayout> <ListView x:Name=”listDictionaries” ItemsSource=”{Binding DictionariesList}” IsVisible=”{Binding ShowList}” HorizontalOptions=”FillAndExpand” VerticalOptions=”FillAndExpand” HasUnevenRows=”true” IsPullToRefreshEnabled=”true” RefreshCommand=”{Binding Refresh}” SeparatorVisibility=”Default” ItemTapped=”OnItemTapped” IsRefreshing=”{Binding IsBusy, Mode=OneWay}”> <ListView.ItemTemplate> <DataTemplate> <ViewCell BindingContextChanged=”OnBindingContextChanged”> <ViewCell.View> <StackLayout> <Grid Padding=”10″ ColumnSpacing=”10″> <Grid.RowDefinitions> <RowDefinition Height=”*” /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width=”Auto” /> <ColumnDefinition Width=”*” /> </Grid.ColumnDefinitions>…
Visual Studio updates Xamarin
When you open Visual Studio 2015 and there is a pop windows to invite you to click on it for updating Xamarin and you click, nothing happends. There is a bug but clicking the update available popup was fixed in one of the recent releases. You can manually update in the Options menu under Tools. As for the errors, I get those all the time. Support packages can often be a problem. Update to the latest XF package. Try deleting bin, obj, and the contents of packages folders and rebuild.
How to update the data in listview in Xamarin.Forms?
First you add a new class as a ViewModel like: public class RoomViewModel : BaseViewModel { [here following code] } If you don’t have BaseViewModel try to download from nuget Refractored.MvvmHelpers. Then in your class define an observable collection like public ObservableCollection<RoomRecommandation> _roomSuggestionList = new ObservableCollection<RoomRecommandation>(); public ObservableCollection<RoomRecommandation> Recommendations { get { return _roomSuggestionList; } } In your ContentPage add a listview like: <ListView ItemsSource="{Binding Recommendations}"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <Grid Padding="10" RowSpacing="10" ColumnSpacing="10"> <Grid.RowDefinitions> <RowDefinition Height="" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <controls:CircleImage…
Xamarin Forms MasterDetail Page Navigation Recipe
In this recipe I will show you how to add a hamburger menu to your Xamarin Forms application using the MasterDetailPage class. The Xamarin.Forms MasterDetail Page consists of one page for the master and one or more pages for the detail. When used for the main navigation, as in this recipe, we will have a single master page and 4 detail pages. The code for this recipe comes from the Xamarin Forms CRM sample. I have simplified and streamlined the code, and a full Xamarin Studio solution is included at…
Xamarin Studio: complete uninstall on Mac
Remove these directories: /Applications/Xamarin Studio.app /Developer/MonoTouch /Developer/MonoAndroid /Library/Frameworks/Mono.framework /Library/Frameworks/Xamarin.Mac.framework /Library/Frameworks/Xamarin.Android.framework Locations in your user directory: ~/Library/Caches/Xamarin ~/Library/Caches/XamarinStudio-4.0 ~/Library/Developer/Xamarin ~/Library/Developer/XamarinStudio ~/Library/Logs/Xamarin ~/Library/Logs/XamarinStudio-4.0 ~/Library/Preferences/Xamarin ~/Library/Preferences/XamarinStudio-4.0 ~/Library/Xamarin ~/Library/Xamarin.Mac ~/Library/MonoTouch ~/Library/MonoAndroid ~/Library/XamarinStudio-4.0 That’s all there is afaik.
Sequoia doesn’t work with MAUI
Sequoia doesn’t work with MAUI. Now I can’t try my apps on iOS. It is still working for macOS. Here the solution!
Language Dropdown for MAUI
I released a new component called Language Dropdown for MAUI. This displays a dropdown with all the languages in the world with their flags
MAUI raises on iOS MT1045
When from Visual Studio you deploy a real device a MAUI application raises on iOS the error MT1045. Here what to check to fix the problem
MAUI Push Notifications using Azure Notification Hub for iOS
Here the new post where I explain how to implement the Push Notifications in MAUI using Azure Notification Hub for iOS without external plugin
Deploy MAUI apps on a real device
Developing applications with NET8 MAUI, we want to deploy apps on a real device. Here are all the necessary steps without wasting time.
MAUI Push Notifications using Azure Notification Hub for Android
Here is how to implement in a MAUI project the Push Notifications using Azure Notification Hub for Android. It works simply fine!
Using SecureStorage with MAUI
Using SecureStorage with MAUI with the correct setup in your NET8 MAUI applications. Here the solution for iOS and Android.
MAUI Push Notifications using Azure Notification Hub
Here how implement in NET8 MAUI the push notifications using Azure Notification Hub without any external package for Windows. Very hard work!
Some lessons I learned about MAUI
I want to share with you some lessons I learned about MAUI. In the last few months, I have been creating an application using NET8 MAUI.
Use biometric authentication in MAUI
In this post I show how to use biometric authentication in MAUI in your applications for iOS and Android and in machines with Windows Hello
.NET is the most loved platform
.NET is the most loved platform! It’s won most loved platform 3 years in a row in the annual StackOverflow developer survey
MAUI Release Candidate is here
The exciting news in April for mobile app development is that the release of .NET MAUI Release Candidate (RC) is here.
Start with Unity 2021
In this new post I explain how to start with Unity 2021 and the basic interaction with the Unity Editor, navigate the functions of the editor
Install MAUI with Visual Studio 2022 (Preview)
In this new post I show you how to install MAUI with Visual Studio 2022 (Preview) after the official release of Visual Studio 2022.
Getting started with Swift development
Getting started with Swift development is a quick post to give you the basis to start creating apps with your Mac but also with Windows
Install MAUI with Visual Studio 2022
Microsoft is talking a lot about this new technology and here I will explain how to install MAUI with Visual Studio 2022 and run a first app