xamarin.forms

Show Acr User Dialogs loader until end of method xamarin forms (android)

六月ゝ 毕业季﹏ 提交于 2020-07-08 09:39:10
问题 I use ShowLoading() Acr UserDialogs (v5.2.2) on my xamarin forms project (android and ios) but i wont start loader before start await method and Hide Loader with the end. My code working on ios but on android nothing happened. example async Task MyMethod() { UserDialogs.Instance.ShowLoading("Loading",MaskType.Black); await ViewModel.LoadData(); UserDialogs.Instance.HideLoading(); } //InsideViewModel public async Task LoadData(); { await Task.Yield(); //without this code and ios doesnt work /

How to create a image picker on Xamarin Forms?

和自甴很熟 提交于 2020-07-07 12:00:26
问题 Does anybody knows if its possible to make a Image picker like this: I've tried with the followings plugins : https://github.com/jamesmontemagno/MediaPlugin https://github.com/matheusneder/Xamarin.Forms.ImagePicker I do not want to create buttons to be able to perform each operation, what I want is that with a single button I suggest which application to use. This is possible? Thanks. 回答1: If you want to pick a photo from the phone's picture library, due to Xamarin.Forms does not include this

Xamarin.Forms Set video as splash screen

五迷三道 提交于 2020-07-06 20:20:33
问题 I am working on xamarin.forms shared project. I am facing problem in setting video as splash screen. I got reference from here. The problem I face is video player is initialized and doing its process and in that time, AppDelegate code returns first. so video is not displayed but its sound is coming. Is there anything I am missing ? Here I merged VideoController and VideoViewController of the sample. I only use VideoViewController and refer my video from Resources folder in SetMoviePlayer()

Xamarin.Forms Set video as splash screen

喜欢而已 提交于 2020-07-06 20:20:00
问题 I am working on xamarin.forms shared project. I am facing problem in setting video as splash screen. I got reference from here. The problem I face is video player is initialized and doing its process and in that time, AppDelegate code returns first. so video is not displayed but its sound is coming. Is there anything I am missing ? Here I merged VideoController and VideoViewController of the sample. I only use VideoViewController and refer my video from Resources folder in SetMoviePlayer()

Xamarin.Forms - how to absolutely center an element on the page?

杀马特。学长 韩版系。学妹 提交于 2020-07-04 07:12:58
问题 I have a login page using a StackLayout for the content (username, password, login button). After the user clicks the login button, I want a "loading" block set in the absolute center of the page, on top of the existing StackLayout content. For some annoying reason, this is not straightforward. It seems like a simple, common thing to do - how is this done? 回答1: You used a right tag: AbsoluteLayout. var loadingView = new StackLayout { Padding = 6, Orientation = StackOrientation.Horizontal,

Xamarin.Forms - how to absolutely center an element on the page?

若如初见. 提交于 2020-07-04 07:12:51
问题 I have a login page using a StackLayout for the content (username, password, login button). After the user clicks the login button, I want a "loading" block set in the absolute center of the page, on top of the existing StackLayout content. For some annoying reason, this is not straightforward. It seems like a simple, common thing to do - how is this done? 回答1: You used a right tag: AbsoluteLayout. var loadingView = new StackLayout { Padding = 6, Orientation = StackOrientation.Horizontal,

How to implement a single Google map in both platforms Android and iOS using Xamarin Forms?

◇◆丶佛笑我妖孽 提交于 2020-07-03 05:41:39
问题 I have a Google map API key and I want to use that to show maps in my Android app and iOS app using Xamarin Forms. 回答1: An easy way to implement that is using the NuGet Xamarin.Forms.GoogleMaps Xamarin.Forms.GoogleMaps features: Map types Traffic map Map events Panning with animation Panning directly Pins Custom Pins Pin drag & drop Polygons Lines Circles Custom map tiles Follow the next steps to set up maps in your project: Install the NuGet package Xamarin.Forms.GoogleMaps in all projects.

Format DateTime in Xamarin Forms to Device Format string

此生再无相见时 提交于 2020-07-02 07:32:19
问题 How can I format a DateTime object to a string in the device default datetime format when running a PCL Xamarin.Forms project and my deployement targets include iOS, Android and Windows. The DateTime.ToShortString() doesn't work as per MSDN requirement according to this thread and this bug. Is there any Forms based solution or do I need to get it from platform specific projects? For Android, I can do the following from Native project using DI: String format = Settings.System.GetString(this

Format DateTime in Xamarin Forms to Device Format string

余生长醉 提交于 2020-07-02 07:31:10
问题 How can I format a DateTime object to a string in the device default datetime format when running a PCL Xamarin.Forms project and my deployement targets include iOS, Android and Windows. The DateTime.ToShortString() doesn't work as per MSDN requirement according to this thread and this bug. Is there any Forms based solution or do I need to get it from platform specific projects? For Android, I can do the following from Native project using DI: String format = Settings.System.GetString(this

Xamarin: Visual State Manager and custom properties

人走茶凉 提交于 2020-06-29 07:02:17
问题 I am trying to set a custom property on a custom control using the Visual State Manager but I'm not having any luck so far. My custom control is just a label with an additional bindable property on it. public class SelectableLabel : Label { public static readonly BindableProperty IsSelectedProperty = BindableProperty.Create("IsSelected", typeof(bool), typeof(SelectableLabel), false); public bool IsSelected { get { return (bool)GetValue(IsSelectedProperty); } set { Console.WriteLine($"MDO: