Questions tagged [xamarin.forms]

Xamarin.Forms is a Microsoft product allowing the building of native, cross-platform apps for Android, iOS, Windows, and others from a single shared C# codebase.

Xamarin.Forms is a cross-platform natively backed UI toolkit abstraction that allows developers to easily create user interfaces that can be shared across multiple platforms such as Android, iOS, and Windows. The user interfaces are rendered using the native controls of the target platform, allowing Xamarin.Forms applications to retain the appropriate look and feel for each platform.

Xamarin.Forms learning resources are available for free at Microsoft Learn

Read the Xamarin.Forms introduction for more information.

  • Xamarin.Forms were introduced in Xamarin 3 on May 28, 2014.

  • Code sharing techniques include Shared Projects and .NET Standard Libraries. Details can be found on the Xamarin.Forms Code Sharing page.

  • Supported platforms are listed on the Xamarin.Forms GitHub Wiki.

  • Xamarin.Forms releases are listed on developer.xamarin.com, releases.xamarin.com, nuget.org, and github.com.

  • Xamarin.Forms 5.0 is the last version of this platform, and it will continue to receive service releases through November 2022. .NET MAUI will be the evolution of the platform. Xamarin.Forms 5.0 apps will migrate to .NET 6 and upgrade directly to .NET MAUI.

What's in the box?

Pages

  • ContentPage
  • MasterDetailPage
  • NavigationPage
  • TabbedPage
  • CarouselPage
  • TemplatedPage

Layouts

  • StackLayout
  • AbsoluteLayout
  • RelativeLayout
  • GridLayout
  • FlexLayout
  • ContentView
  • ScrollView
  • Frame
  • ContentPresenter
  • TemplatedView

Controls

  • ActivityIndicator
  • BoxView
  • Button
  • CarouselView
  • CollectionView
  • CheckBox
  • DatePicker
  • Editor
  • Entry
  • Ellipse
  • Expander
  • Image
  • ImageButton
  • IndicatorView
  • Label
  • Line
  • ListView
  • Map
  • MediaElement
  • OpenGLView
  • Path
  • Picker
  • Polygon
  • Polyline
  • ProgressBar
  • RadioButton
  • Rectangle
  • RefreshView
  • SearchBar
  • Slider
  • Stepper
  • SwipeView
  • Switch
  • TimePicker
  • TableView
  • WebView

Useful Links

34439 questions
182
votes
3 answers

What is the difference between Xamarin.Form's LayoutOptions, especially Fill and Expand?

In Xamarin.Forms every View has the two properties HorizontalOptions and VerticalOptions. Both are of type LayoutOptions and can have one of the following…
Falko
  • 17,076
  • 13
  • 60
  • 105
172
votes
3 answers

What is the difference between Xamarin.Forms and Xamarin Native?

I am confused between Xamarin.Forms and Xamarin native. What is the difference between the two? So what are the technical positives and negatives of using Xamarin.Forms over Xamarin Native?
Ajay Kumar
  • 2,031
  • 2
  • 13
  • 17
117
votes
13 answers

How do you switch pages in Xamarin.Forms?

How do you switch between pages in Xamarin Forms? My main page is a ContentPage and I don't want to switch to something like a Tabbed Page. I've been able to pseudo-do it by finding parents of the controls that should trigger the new page until I…
Eric
  • 1,882
  • 3
  • 16
  • 21
116
votes
21 answers

Toast equivalent for Xamarin Forms

Is there any way using Xamarin Forms (not Android or iOS specific) to have a pop-up, like Android does with Toast, that needs no user interaction and goes away after a (short) period of time? From searching around all I'm seeing are alerts that…
Jimmy
  • 1,299
  • 2
  • 10
  • 14
103
votes
11 answers

The SSL connection could not be established

I am using a third party library (Splunk c# SDK ) in my ASP.NET core application. I am trying to connect to my localhost Splunk service via this SDK, but I get an exception saying: System.Net.Http.HttpRequestException: The SSL connection could…
MVafa
  • 1,121
  • 2
  • 8
  • 6
96
votes
10 answers

PushAsync is not supported globally on Android, please use a NavigationPage - Xamarin.Forms

I have the following method in an Xamarin.Forms.ContentPage wired to a button click event public class LoginPage : ContentPage { private Button _loginButton = null; private Entry _PasswordInput = null; private Entry _UsernameInput =…
Michael Kniskern
  • 24,792
  • 68
  • 164
  • 231
86
votes
16 answers

Xamarin.Forms ListView: Set the highlight color of a tapped item

Using Xamarin.Forms, how can I define the highlight/background color of a selected/tapped ListView item? (My list has a black background and white text color, so the default highlight color on iOS is too bright. In contrast, on Android there is no…
Falko
  • 17,076
  • 13
  • 60
  • 105
75
votes
34 answers

Xamarin.Forms - InitializeComponent doesn't exist when creating a new page

I'm using Visual Studio to try out Xamarin.Forms. I'm trying to follow the guide: http://developer.xamarin.com/guides/cross-platform/xamarin-forms/xaml-for-xamarin-forms/getting_started_with_xaml/ In short, I create a Xamarin.Forms solution using a…
user2915962
  • 2,691
  • 8
  • 33
  • 60
70
votes
5 answers

How can I save some user data locally on my Xamarin Forms app?

I have a simple Xamarin Forms app. I've now got a simple POCO object (eg. User instance or an list of the most recent tweets or orders or whatever). How can I store this object locally to the device? Lets imagine I serialize it as JSON. Also, how…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
68
votes
4 answers

In Xamarin.Forms Device.BeginInvokeOnMainThread() doesn’t show message box from notification callback *only* in Release config on physical device

I'm rewriting my existing (swift) iOS physical therapy app "On My Nerves" to Xamarin.Forms. It's a timer app to help people with nerve damage (like me!) do their desensitization exercises. You have these "fabrics" (e.g. a feather) where each fabric…
saraford
  • 729
  • 5
  • 5
66
votes
9 answers

How to change application icon in Xamarin.Forms?

I replaced all the images everywhere (by this I mean in drawable folders and all Windows Assets folders and iOS Resources folder), but it still shows me the default Xamarin icon for the app. I tried this code, too, but it doesn't seem to work…
Szandi
  • 883
  • 2
  • 7
  • 8
65
votes
8 answers

Xamarin Forms: StackLayout with rounded corners

I am developing an app using Xamarin Forms PCL. I need a StackLayout with rounded corners. I have tried frame as well for rounded corner container but there is no corner radius property available for it. I cannot find renderers for…
Sonali
  • 2,223
  • 6
  • 32
  • 69
63
votes
11 answers

Build action 'EmbeddedResource' is not supported by one or more of the project's targets

I am new to Xamarin platform, and am facing the error Build action 'EmbeddedResource' is not supported by one or more of the project's targets. Am debugging in emulator 8.1 for windows phone, and my project is a Xamarin.form(portable).
Arun
  • 851
  • 1
  • 9
  • 19
63
votes
6 answers

How to use Push Notifications in Xamarin Forms

I have an app using Xamarin.Forms targeting IOS, Android and WP 8. I need push notification feature in my app. I have seen the pushsharp demos and it seems promising. But all the code I have seen is done separately for each platform. I would like it…
Rohit Vipin Mathews
  • 11,629
  • 15
  • 57
  • 112
57
votes
5 answers

Xamarin Forms - negate bool binding values

I am learning the xamarin forms and mvvm pattern. I am wondering, if is it possible to negate binding bool value. What I mean is: I have, let's say Entry with isVisible Binding:
Grzegorz G.
  • 1,285
  • 2
  • 14
  • 27
1
2 3
99 100