标签:android http io ar sp 问题 c on cti
一:有EditTexit时自动获取焦点
      1、获得焦点不弹出输入框, 隐藏软键盘;     
2、不让文本框获得焦点;
方法一:
在<activity>标签中加入: android:windowSoftInputMode = "stateHidden"
方法二:
在OnCreate()中
getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN)
方法三:
   我们可以抢占文本框的焦点,如在其父窗体中加入:
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    tools:context=".MainActivity" > 
      <EditText 
         android:id="@+id/etMsg" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        /> 
     </LinearLayout> 
二:默认弹出的键盘模式就是数字键盘。
EditText et = (EditText) findViewById(R.id.editNum); 
         et.setInputType(InputType.TYPE_CLASS_NUMBER);
给你的EditText设置输入类型 TYPE_CLASS_NUMBER,这样你在点击EditText的时候,默认弹出的键盘模式就是数字键盘。
标签:android http io ar sp 问题 c on cti
原文地址:http://my.oschina.net/u/1389206/blog/324722