Prevent EditText from automatically focusing

前端 未结 5 397
心在旅途
心在旅途 2021-01-14 08:43

I have an Android activity and there is one EditText in the whole layout. For some reason, whenever the activity starts, the keyboard comes up. I have tried

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-14 08:55

    Try these for Xamarin.Android (Cross Platform)

    this.Window.SetSoftInputMode (SoftInput.StateHidden);
    

    Or

    Add this to manifest,

    [Activity(Label = "SampleApp", MainLauncher = true, Icon = "@drawable/icon", WindowSoftInputMode = SoftInput.StateHidden)]
    

提交回复
热议问题