当前位置:首页 > Android

EditText焦点

jsc12年前 (2014-08-28)Android3630
<LinearLayout 
        style="@style/FillWrapWidgetStyle"
        android:orientation="vertical"
        android:background="@color/black"
        android:gravity="center_horizontal"
        android:focusable="true"  //不自动获取焦点
        android:focusableInTouchMode="true"//不自动获取焦点
        >
//获得焦点
et_text.requestFocus();
// 获取编辑框焦点
editText.setFocusable(true);
//打开软键盘
IInputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
如果你想关闭的话在清单文件中的本activity 属性 android:windowSoftInputMode=”stateHidden”


扫描二维码推送至手机访问。

版权声明:本文由微小站发布,如需转载请注明出处。

本文链接:https://jsc0.com/post/21.html

分享给朋友:

“EditText焦点” 的相关文章

Android中Parcelable接口用法

1. Parcelable接口Interface for classes whose instances can be written to and restored from a Parcel。 Classes implementing the Parcelabl…

Fragment生命周期

Fragment生命周期

onAttach方法:Fragment和Activi…

Android 学习之 开源项目PullToRefresh的使用

Android 学习之 开源项目PullToRefresh的使用

首先 下载 Android-PullToRefresh-master ˂img src="http://photo.jsc…

采用SharedPreferences保存用户偏好设置参数

采用SharedPreferences保存用户偏好设置参数-------------------------------------------------1.eclipse就是通过xml来保存用户的偏好设置-->window-->perfences-------------------…

采用SharedPreferences保存用户偏好设置参数和读取设置参数

采用SharedPreferences保存用户偏好设置参数和读取设置参数

Android SDK支持那些文件存储技术? 1. 使用SharedPreferences保存key-value类型的数据 ˂span style="font…