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.

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

29936 questions
178
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
  • 15,326
  • 12
  • 50
  • 91
166
votes
3 answers

When to use Xamarin.Forms vs Xamarin Native?

I need to make a decision between using Xamarin.Forms vs Xamarin native to develop an app. I want to go with Xamarin.Forms as UI code will be shared as well. So what are the technical positives and negatives of using Xamarin.Forms over Xamarin…
Ajay Kumar
  • 1,961
  • 2
  • 11
  • 17
109
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,782
  • 3
  • 15
  • 21
99
votes
18 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,119
  • 1
  • 9
  • 11
81
votes
14 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
  • 15,326
  • 12
  • 50
  • 91
81
votes
9 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
  • 23,162
  • 65
  • 156
  • 224
74
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,547
  • 5
  • 28
  • 54
69
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
  • 739
  • 5
  • 5
65
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
  • 78,923
  • 102
  • 356
  • 586
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
  • 852
  • 1
  • 9
  • 19
61
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 codes I have seen are done separately for each platform. I would…
Rohit Vipin Mathews
  • 10,853
  • 15
  • 49
  • 100
59
votes
9 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
  • 1,895
  • 5
  • 27
  • 56
55
votes
8 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
  • 653
  • 1
  • 6
  • 8
52
votes
8 answers

Remove ios, windows8, and wp8 from Xamarin Forms PCL - nuget 3.0 opt-into error?

I'm working on a Xamarin Forms project. I want to target Android and Windows 10 UWP. When I try to clean up the PCL by removing "Windows 8", "Windows Phone Silverlight 8", "Windows Phone 8.1", "Xamarin.ios", and "Xamarin.ios (classic)" from the…
Joe Healy
  • 5,349
  • 3
  • 32
  • 54
51
votes
2 answers

Xamarin Forms StackLayout: How to set width / height of children to percentages

Is there a way to create a vertical stack layout with a button that takes 30% of of the parent, and a text input that takes 70% of the parent? Something like this:
sgarcia.dev
  • 4,375
  • 11
  • 33
  • 57
1
2 3
99 100