Android應(yīng)用啟動(dòng)時(shí),焦點(diǎn)直接在EditText上,輸入法直接打開,影響界面美觀。
導(dǎo)致進(jìn)入畫面入就打開輸入法,影響界面美觀。
默認(rèn)焦點(diǎn)的順序是:從上倒下 從左到右第一個(gè)可以輸入的控件作為焦點(diǎn) 可以使用:
btSearch.setFocusable(true);
btSearch.requestFocus();
btSearch.setFocusableInTouchMode(true);
也可以:
在EditText前面放置一個(gè)看不到的LinearLayout,讓他率先獲取焦點(diǎn):
<LinearLayout android:focusable="true" android:focusableInTouchMode="true" android:layout_width="0px" android:layout_height="0px"/>
posted on 2012-03-24 15:33
小果子 閱讀(395)
評(píng)論(0) 編輯 收藏 引用 所屬分類:
Android & Ios