, , OnInterceptTouchEvent, false, , .
The example below is for Xamarin, but it is easy to port it to Java:
public class KeyboardHidingScrollView : ScrollView
{
public KeyboardHidingScrollView (Context context) : base (context)
{
}
public KeyboardHidingScrollView (Context context, IAttributeSet attrs) : base (context, attrs)
{
}
public override bool OnInterceptTouchEvent (Android.Views.MotionEvent ev)
{
var methodManager = (InputMethodManager)Context.GetSystemService (Context.InputMethodService);
methodManager.HideSoftInputFromWindow (WindowToken, HideSoftInputFlags.None);
return false;
}
}
source
share