当前位置:首页 » 安卓系统 » androidedittext遮挡

androidedittext遮挡

发布时间: 2022-06-25 22:45:03

⑴ Android EditText 问题

首先我觉得hint的用途就是提示效果,当你在编辑框输入了数据,hint就变得无意义了。至于你说的实体和hint要共存,可以换成其他的方法实现:第一个就是每一行一个textview+edittext ,第二种方法就是“给edittext”设置属性“android:drawableLeft="xxxx"”(xxx放一张写有实体的.PNG图片)

至于数光标的位置要重定向,要是按照layout的布局的中顺序,你的“账号”实体也是edittext。理应先获取聚焦,是否可以尝试下在代码中使用第一个账号实体的edittext对象的方法(findFocus())还有在布局的文件中设置该edittext控件添加试试

<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="5"
android:minLines="1"
android:maxLength="50"
android:hint="总感觉很空,写点什么吧!"
android:inputType="textMultiLine" >
<requestFocus />------------->添加这个
</EditText>

⑵ android 去掉沉浸式edittext还是被软键盘遮住了

在程序中加入以下代码时,软键盘会出现: InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); imm.toggleSoftInput(0, InputMethodManager.RESULT_SHOWN); 如果要让软键盘消失,则为以下代码: InputMethod...

⑶ android EditText在获得焦点的时候下面的Tab被输入法顶上去了

在对应的Activity声明中加一个这个属性试试
android:windowSoftInputMode="adjustPan"

⑷ 怎么把android软键盘把布局顶上去

在EditText控件接近底部的情况下,软键盘弹出后会把获得焦点的EditText控件遮挡,无法看到输入信息,防止这样的情况发生,就需要设置AndroidManifest.xml的属性:
前面的xml信息省略
在activity中 增加android:windowSoftInputMode="adjustPan"
<activity
..
android:windowSoftInputMode="adjustPan"
>
</activity>
弹出软键盘以后,软键盘会把EditText推上去。

⑸ 在android中点击EditText的时候会弹出软键盘,这时候如果想隐藏软键盘或者填完内容后点其他的地方直接隐藏

1)在Manifest.xml文件中相应的activity下添加一下代码:
android:windowSoftInputMode="stateHidden"

2)让EditText失去焦点,使用EditText的clearFocus方法
例如:EditText edit=(EditText)findViewById(R.id.edit);
edit.clearFocus();

3)强制隐藏Android输入法窗口
例如:EditText edit=(EditText)findViewById(R.id.edit);
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(edit.getWindowToken(),0);

4).EditText始终不弹出软件键盘
例:EditText edit=(EditText)findViewById(R.id.edit);
edit.setInputType(InputType.TYPE_NULL);

⑹ 新手关于android studio中edittext问题

  1. editText.getText().toString()获取EditText控件输入的内容,onClick()方法表示点击的时候执行里面的代码

  2. 放置在外面表示启动当前Activity就执行了editText.getText().toString()方法,这个时候EditText控件还没有输入任何东西,自然是空的

  3. 当把editText.getText().toString()放置在onClick()方法里面,表示在大家按钮的时候执行上面方法,如果这个时候不输入任何内容,点击按钮,自然也是空的(原理和放置在外面一样)

⑺ android每当输入新的EditText数据,TextView里的append就会覆盖原有的数据,如何不覆盖原有的数据

可以使用intent把输入的数据传过去后再使用append追加,如果不行,那你就直接在Activity1追加后再传去Activivty2

⑻ android 如何去掉edittext边框

java">将edittext的style设置成?android:attr/textViewStyle取消掉默认的样式,在设置background为@null接下来就是一个空空的edittext了(比如http://www.tiecou.com/)
,在两个edittext中间加一个view,设置background为灰色,宽度match_parent,高度2dip看看。

RelativeLayoutxmlns:android="

xmlns:tools="

android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/darker_gray">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@android:color/white"
android:orientation="vertical">

<EditText
style="?android:attr/textViewStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:hint="输入用户名"
android:paddingBottom="5dip"
android:paddingTop="5dip"/>

<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="@android:color/darker_gray"/>

<EditText
style="?android:attr/textViewStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:hint="输入密码"
android:inputType="textPassword"
android:paddingBottom="5dip"
android:paddingTop="5dip"/>
</LinearLayout>
</RelativeLayout>

⑼ Android当重新输入内容时,把之前edittext的内容覆盖

在edittext获取焦点的时候给edittext.setText("");设个空字符串就好了 希望对你有帮助.

热点内容
怎么把电脑锁上密码 发布:2024-05-20 05:19:09 浏览:982
安卓为什么连上wifi后没有网络 发布:2024-05-20 05:17:50 浏览:417
安卓usb在设置哪里 发布:2024-05-20 05:03:03 浏览:185
绥化编程 发布:2024-05-20 04:59:44 浏览:989
基本原理和从头计算法 发布:2024-05-20 04:50:32 浏览:28
配置情况指的是什么 发布:2024-05-20 04:48:14 浏览:495
那个程序用来编译源文件 发布:2024-05-20 04:46:45 浏览:549
小程序需要数据库吗 发布:2024-05-20 04:35:14 浏览:337
链接sqlserver 发布:2024-05-20 04:27:53 浏览:209
ftp文件服务器扩容 发布:2024-05-20 04:22:21 浏览:646