c# - Not to show keyboard when focusing a searchbox -


i developing app (in xamarin.forms) used external barcode scanner, i don't need show tactile keyboard each time put focus in entry/searchbox/etc.

how can this?

thanks guys.

assuming never want keyboard never show whatsoever on entry, can set keyboard property null in entry's constructor.

var scannerentry = new entry {     keyboard = null,     placeholder = "scan item" }; 

because xamarin.forms api not expose keyboard property on searchbar class, can write custom renderer. ios implementation can use resignfirstresponder in onelementchanged override prevent keyboard ever showing:

[assembly: exportrenderer(typeof(scannersearchbar), typeof(scannersearchbardrenderer))] namespace hidekeyboard.ios {     public class scannersearchbarrenderer : searchbarrenderer     {         protected override void onelementchanged(elementchangedeventargs<xamarin.forms.searchbar> e)         {             base.onelementchanged(e);             if (control != null)             {                 if (focused)                 {                     resignfirstresponder();                 }             }         }     } } 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -