2015-11-03 99 views
0

我有幾個EditText視圖。我已經爲其中的每一個添加了「接下來的」操作,並將「完成」操作添加到最後一個。它的行爲是正確的,唯一的問題是輸入按鈕上沒有「下一個」字符串。它只顯示簡單的輸入按鈕,沒有「下一個」或「完成」按鈕。sofkeyboard上的下一個按鈕沒有顯示在android

UPDATE

好像它在我的HTC的工作錯了一個X(安卓5.0.2),但我已經測試了三星S3(Android 4.4系統)和它的作品如預期

    <EditText 
         android:id="@+id/edit1" 
         android:layout_width="0dp" 
         android:layout_height="wrap_content" 
         android:layout_weight="1" 
         android:imeOptions="actionNext" 
         android:singleLine="true" 
         android:ems="10" 
         android:inputType="textCapCharacters"/> 

        <EditText 
         android:id="@+id/edit2" 
         android:layout_width="wrap_content" 
         android:layout_height="match_parent" 
         android:imeOptions="actionDone" 
         android:singleLine="true" 
         android:ems="10" 
         android:inputType="textCapCharacters"/> 

enter image description here

+0

嘗試刪除'android:inputType =「textCapCharacters」' – Tauqir

+0

@Tauqir我試過不同的情況刪除了inputType,刪除了ems,刪除了單行。沒有幫助 –

回答

0

當您不指定與下一個動作相關的下一個項目時,Android會嘗試猜測可能是下一個動作的項目。有時它可能會猜測它是錯誤的,所以最好總是明確告知與該元素相關的下一個項目是什麼。你可以做到這一點:

android:nextFocusForward="next_element_id" 

android:nextFocusUp="up_element_id" 
android:nextFocusDown="down_element_id" 
android:nextFocusLeft="left_element_id" 
android:nextFocusRight="right_element_id" 

希望這有助於!

相關問題