版权声明:本文为博主原创文章。未经博主同意不得转载。 https://blog.csdn.net/mingyue_1128/article/details/31376159

在xml文件里的EditText中加入

   android:imeOptions="actionSearch" 属性


代码中这样写

et_main_search.setOnKeyListener(new OnKeyListener() {//输入完后按键盘上的搜索键【回车键改为了搜索键】

			public boolean onKey(View v, int keyCode, KeyEvent event) {
				
			if(keyCode==KeyEvent.KEYCODE_ENTER){//改动回车键功能
			
				
			}
	
			return false;
		}
	});


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2021-06-21
  • 2022-02-01
  • 2022-01-14
  • 2021-06-24
  • 2022-12-23
猜你喜欢
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-02
相关资源
相似解决方案