xamarin-forms

Xamarin Forms custom theme not working

倾然丶 夕夏残阳落幕 提交于 2019-12-06 07:42:50
I have an Android app that uses Xamarin Forms 2.0. I made a custom theme to set some colors. I created these files: Resources/values/styles.xml (AndroidResource) <?xml version="1.0" encoding="utf-8" ?> <resources> <style name="SmartbitLight" parent="SmartbitLight.Base"> </style> <style name="SmartbitLight.Base" parent="Theme.AppCompat.NoActionBar"> <item name="colorPrimary">@color/blueLight</item> <item name="colorPrimaryDark">@color/blueDark</item> <item name="colorAccent">@color/grey</item> <item name="android:windowBackground">@color/white</item> <item name="android:textColorPrimary">@color

How to change Xamarin back button in menu bar?

♀尐吖头ヾ 提交于 2019-12-06 02:09:40
this is what I have: this is what I want to get: If there is no pages in navigation stack, then title icon will be in left corner, else there will be back arrow and "Back" text. I didn't find any options to customize it, is it possible at all? Daniel Luberda You can change arrow to hamburger icon if you use your MasterPage within NavigationPage: Detail = new NavigationPage(masterPage); If you want to hide icon - it only applies to Android. It can be solved with custom renderer ( http://developer.xamarin.com/guides/cross-platform/xamarin-forms/custom-renderer/ ): [assembly:ExportRenderer

Hide StatusBar for specific ContentPage

孤人 提交于 2019-12-04 08:39:25
问题 I'm creating an app where I want to hide the statusbar on a specific page. In my example it's a ContentPage. I found several samples where the info.plist is used to hide it, but I only want it for a specific page, is it possible? It's easy to hide the navigationbar with NavigationPage.SetHasNavigationBar, but statusbar seems a bit different. 回答1: As far as I know, Xamarin doesn't provide this functionality through Xamarin.Forms classes. You will need to implement it in each platform specific

Xamarin Forms image not showing

我与影子孤独终老i 提交于 2019-12-04 00:00:43
问题 I have a Xamarin Forms (2.0) Android app where I'm trying to show an image. I've got an icon called icon-pages-r1.png which I'm trying to show using the following code: <Image Source="icon-pages-r1.png" /> The image isn't showing though. When I change the source to Icon.png (the default Xamarin icon) it does work. The image is a semi-transparent PNG (thus a colored icon in the middle and transparent around it), it's 46x46 and in Windows it shows fine as item type PNG File. I tried opening the

Xamarin Forms error using System.Timers and Sysem.Json

懵懂的女人 提交于 2019-12-02 13:43:15
问题 I want to use System.Timer in my Xamarin Forms based project. I am actually converting my Xamarin iOS project to Xamarin Formbased project. My Xamarin iOS project has all code for Timer using System.Timer aTimer = new Timer (tm); // Hook up the Elapsed event for the timer. aTimer.Elapsed += new ElapsedEventHandler (OnTimedEvent); aTimer.Enabled = true; aTimer.Start (); When i try to use the same code in Xamarin Forms project it is giving error. First of all using System.Timers; It says: The

Xamarin Forms error using System.Timers and Sysem.Json

好久不见. 提交于 2019-12-02 03:52:44
I want to use System.Timer in my Xamarin Forms based project. I am actually converting my Xamarin iOS project to Xamarin Formbased project. My Xamarin iOS project has all code for Timer using System.Timer aTimer = new Timer (tm); // Hook up the Elapsed event for the timer. aTimer.Elapsed += new ElapsedEventHandler (OnTimedEvent); aTimer.Enabled = true; aTimer.Start (); When i try to use the same code in Xamarin Forms project it is giving error. First of all using System.Timers; It says: The type or namespace name Timers does not exist in the namespace System. Are you missing a assembly

Is there a datetimepicker class in Xamarin?

本小妞迷上赌 提交于 2019-12-02 03:46:27
问题 I am currently using the Xamarin Forms DatePicker and the TimePicker in the portable project of a portable app. But is there a combined control that lets you choose date and time at once (like DateTimePicker in Windows forms)? Please have a look at the iOS Settings > General > Date & Time (http://www.iphonefaq.org/images/archives/pangu-date.jpg). Or is there anything I am missing on how to create such a control? 回答1: There is not a "stock" DateTimePicker within the controls for Xamarin.Forms

Is there a datetimepicker class in Xamarin?

微笑、不失礼 提交于 2019-12-02 02:39:50
I am currently using the Xamarin Forms DatePicker and the TimePicker in the portable project of a portable app. But is there a combined control that lets you choose date and time at once (like DateTimePicker in Windows forms)? Please have a look at the iOS Settings > General > Date & Time ( http://www.iphonefaq.org/images/archives/pangu-date.jpg ). Or is there anything I am missing on how to create such a control? There is not a "stock" DateTimePicker within the controls for Xamarin.Forms . You could create your composite control using DatePicker and TimePicker within modal popups and display

Timepicker with seconds

家住魔仙堡 提交于 2019-11-30 16:48:57
I am using Xamarin Forms and somewhere in my application, I need the user to be able to enter a time in the format HH:mm:ss. So, basically I need a control like this one: By using a custom iOS render, I've been able to remove the AM/PM part from the TimePicker to achieve something like this: Here's my renderer code: public class TimePickerSecondsRenderer : TimePickerRenderer { protected override void OnElementChanged(ElementChangedEventArgs<TimePicker> e) { base.OnElementChanged(e); var timePicker = (UIDatePicker)Control.InputView; timePicker.Locale = new NSLocale("CA"); } } It's a small step

Timepicker with seconds

人走茶凉 提交于 2019-11-30 16:14:07
问题 I am using Xamarin Forms and somewhere in my application, I need the user to be able to enter a time in the format HH:mm:ss. So, basically I need a control like this one: By using a custom iOS render, I've been able to remove the AM/PM part from the TimePicker to achieve something like this: Here's my renderer code: public class TimePickerSecondsRenderer : TimePickerRenderer { protected override void OnElementChanged(ElementChangedEventArgs<TimePicker> e) { base.OnElementChanged(e); var