Change return to be next/done key in Xamarin Forms Shared Project

A custom EntryRenderer can handle changing the keyboard return key description. iOS : UITextField has a ReturnKeyType property that you can set to a preassigned list (see UIReturnType enum). Android : EntryEditText has a ImeOptions property that controls what the “Action” button on the keyboard does and a SetImeActionLabel method that you can use to … Read more

The “ResolveLibraryProjectImports” task failed unexpectedly

I’ve literally just had this with a brand new Xamarin.Forms application in Visual Studio 2017. The root cause appears to be that I let VS2017 create the project in it’s default location ‘C:\Users\Dave\Documents\Visual Studio 2017\Projects’ and this has resulted in one of more files now having a path which it too long. I moved the … Read more

Write device platform specific code in Xamarin.Forms

This is a scenario which is easily resolved with dependency injection. Have a interface with the desired methods on your shared or PCL code, like: public interface IUserPreferences { void SetString(string key, string value); string GetString(string key); } Have a property on your App class of that interface: public class App { public static IUserPreferences … Read more

Is this a bug in MonoTouch GC?

This is an unfortunate side-effect of MonoTouch (who is garbage collected) having to live in a reference counted world (ObjectiveC). There are a few pieces of information required to be able to understand what’s going on: For every managed object (derived from NSObject), there is a corresponding native object. For custom managed classes (derived from … Read more

Xamarin: Connect to locally hosted web service

If you’re using an Android Emulator then asking for the localhost web service won’t work, because you’re looking at the localhost of the emulator. How can you fix this? Well, Android Emulator has a magic address http://10.0.2.2:your_port that points to 127.0.0.1:your_port on your host machine.Take a look here. Because it points to an IP and … Read more

Xamarin.Forms – How to overlay an ActivityIndicator in the middle of a StackLayout programmatically

If you have problems with RelativeLayout, you can also use AbsoluteLayout which works in a similar context. Sample code below: var overlay = new AbsoluteLayout(); var content = new StackLayout(); var loadingIndicator = new ActivityIndicator(); AbsoluteLayout.SetLayoutFlags(content, AbsoluteLayoutFlags.PositionProportional); AbsoluteLayout.SetLayoutBounds(content, new Rectangle(0f, 0f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize)); AbsoluteLayout.SetLayoutFlags(loadingIndicator, AbsoluteLayoutFlags.PositionProportional); AbsoluteLayout.SetLayoutBounds(loadingIndicator, new Rectangle(0.5, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize)); overlay.Children.Add(content); overlay.Children.Add(loadingIndicator); If you … Read more

Xamarin Forms Swipe Left/Swipe Right Gestures

No need third party libraries.. No need to pay.. Just add these two classes & Implement your swipe listeners Step 1: Copy paste these two classes SwipeListener.cs using System; using Xamarin.Forms; namespace SwipeLib { public class SwipeListener : PanGestureRecognizer { private ISwipeCallBack mISwipeCallback; private double translatedX = 0, translatedY = 0; public SwipeListener(View view, ISwipeCallBack … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)