2012-12-14 24 views
-2

我在編輯字段,但是當我在這個字段中輸入任何文字,然後光標不移動文字,它顯示輸入文字,但光標位置仍然保持在開始位置。當輸入文字時光標不移動

我正在使用Os 6和Os 7/7.1。

請讓我知道這個問題。 以下是它的圖片。

enter image description here

+0

你是否在模擬器上單獨面對這個問題? –

+0

我正面臨着模擬器和設備的這個問題。 – AnkitRox

+0

看起來像已解決 - http://supportforums.blackberry.com/t5/Adobe-AIR-Development/Set-Cursor-Position-for-TextInput/mp/713161#M4153 –

回答

0

我加入以下代碼 - 聚焦狀態和onUnFocus方法文本字段:

protected void onFocus(int direction) { 
    this.setCursorPosition(this.getTextLength()); 
    invalidate(); 
    super.onFocus(direction); 
}; 

protected void onUnfocus() { 
    this.setCursorPosition(this.getTextLength()); 
    invalidate(); 
    super.onUnfocus(); 
}; 

它解決了我的問題。 感謝大家的支持。

相關問題