我正在使用Xamarin(Android)进行开发。现在我想要在点击EditText以外的区域后隐藏键盘。
提前感谢。
提前感谢。
public class MainActivity : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
RequestWindowFeature(WindowFeatures.NoTitle);
SetContentView(Resource.Layout.Main);
EditText Etusername= FindViewById<EditText>(Resource.Id.EtUname);
Etusername.SetHintTextColor(Color.Gray);
InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
imm.HideSoftInputFromWindow(Etusername.WindowToken, 0);
}