<RelativeLayout        android:layout_width="match_parent"        android:layout_height="match_parent"        android:layout_alignParentLeft="true"        android:layout_alignParentStart="true"        android:layout_marginRight="40dp"        android:paddingLeft="12dp"        <strong><span style="color:#ff0000;">android:focusable="true"        android:focusableInTouchMode="true"</span></strong>        android:paddingTop="5dp"        android:paddingBottom="5dp"        android:background="@drawable/background_milkwhite_corner"        android:layout_centerVertical="true">        <ImageView            android:layout_width="18dp"            android:layout_height="18dp"            android:src="@drawable/ic_zoom_gray"            android:layout_marginRight="10dp"            android:id="@+id/zoom"            android:layout_alignParentLeft="true"            android:layout_alignParentStart="true"            android:layout_centerVertical="true" />        <com.zuotu.xiaoqi.widget.ClearEditText            android:id="@+id/searchText"            android:layout_width="match_parent"            android:layout_toRightOf="@+id/zoom"            android:background="@android:color/transparent"            android:imeOptions="actionSearch"            android:layout_marginLeft="10dip"            android:layout_marginRight="10dip"            android:textSize="@dimen/activity_margin_15"            android:textColor="@color/text_dark_gray"            android:singleLine="true"            android:drawableRight="@drawable/delete_selector"            android:hint="@string/addr_hint_input"            android:layout_height="wrap_content"            android:layout_centerVertical="true">        </com.zuotu.xiaoqi.widget.ClearEditText>    </RelativeLayout>


光标设置放在外部的控件上,就可以实现刚进去页面时候没有光标,点击里面的控件的时候,弹出软键盘


此外

AndroidManifest.xml文件里面:

<activity  android:name=".activity.SingleChatActivity"  android:label="@string/addr_infor"  android:theme="@style/CustomActionBarTheme"  android:windowSoftInputMode="stateAlwaysHidden|adjustResize" />
windowSoftInputMode
属性就是总是隐藏软键盘

更多相关文章

  1. Android控件布局属性大全
  2. Android中的webview的进度条
  3. Android(安卓)相对布局
  4. RelativeLayout的常用属性
  5. android隐藏EditText光标
  6. Android(安卓)控件和其基本属性1
  7. 第5章 Android常见XML属性解析-更新中
  8. Android中Button的使用
  9. 相对布局的各个含义

随机推荐

  1. android 读取 IMEI 和 MEID 的处理
  2. Android(安卓)给应用程序的icon添加未读
  3. 在Android上用规则过渡图片实现百叶窗过
  4. Android客户端与服务器交互中的token
  5. 一起来学Android(安卓)Studio:(五)导入 jar
  6. 亚马逊 Kindle Fire 或将成为今年最畅销
  7. Android之MVVM架构指南(一):导语
  8. android自适应draw9patch不失真背景
  9. Android基于XMPP Smack Openfire开发IM(1)
  10. Android中原始资源、任意xml资源和资产的