5
我正在對Xamarin(Android)。現在我想要隱藏鍵盤後點擊外部Edit Text
。如何在Xamarin Android中隱藏鍵盤後單擊外部編輯文字
在此先感謝。
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);
}
感謝您的答覆。我剛剛嘗試了上面的代碼,但沒有改變。 Still鍵盤正在出現。 – raji
@raji看到我的更新答案。 – Ironman
謝謝@Ironman。現在它正在工作。 – raji