Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 具有singline=”属性的EditText;“真的”;不';当键盘出现时,t向上移动_Android - Fatal编程技术网

Android 具有singline=”属性的EditText;“真的”;不';当键盘出现时,t向上移动

Android 具有singline=”属性的EditText;“真的”;不';当键盘出现时,t向上移动,android,Android,转载于Nexus 7 android 4.3 工作流程: 将焦点设置为首次编辑文本-键盘出现,编辑文本为 看得见的 隐藏键盘 将focdus设置为第二次编辑文本-出现键盘,编辑文本 不会向上移动。 (编辑文本在屏幕底部对齐) 公共类MyActivity扩展了活动{ @凌驾 创建时的公共void(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.main); } }

转载于Nexus 7 android 4.3

工作流程:

  • 将焦点设置为首次编辑文本-键盘出现,编辑文本为 看得见的
  • 隐藏键盘
  • 将focdus设置为第二次编辑文本-出现键盘,编辑文本 不会向上移动。
  • (编辑文本在屏幕底部对齐)

    
    公共类MyActivity扩展了活动{
    @凌驾
    创建时的公共void(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    }
    }
    
    我试过这样做:android:windowSoftInputMode=“adjustPan”或adjustPan | adjustResize,但现在效果很好

    有人知道如何解决这个问题吗

    更新:

    我发现:问题出在属性android:singline=“true”中此属性需要显示搜索按钮,并在键盘上点击后开始搜索-否则在单击下一行后显示enter按钮


    Q:您的活动是否全屏显示

    A:是的。但是如果没有这个标志,它仍然会被复制。

    试着这样做

    InputMethodManager imm = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);
        imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
    

    在活动标记下的清单文件中,只需添加:

     android:windowSoftInputMode="adjustpan"
    

    会解决你的问题

    无法将actionSearch类型的textfield指定为单行textfield。请尝试将其删除

    在清单文件中尝试此操作,并添加到活动中

    **

    android:WindowsOfInputMode=“stateVisible | adjustPan”


    **

    您的活动是否全屏显示?您的活动是否全屏显示Yes@Sinigami发布布局xml和活动代码。
    android:windowSoftInputMode="adjustResize"
    
     android:windowSoftInputMode="adjustpan"