【问题标题】:Why setImeOptions doesn't work? Same for setTextSize为什么 setImeOptions 不起作用?与 setTextSize 相同
【发布时间】:2012-12-25 08:43:16
【问题描述】:

我的代码:

TextView tv = new TextView(this);
final EditText newPositionName = new EditText(this);

newPositionName.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
newPositionName.setBackgroundColor(Color.TRANSPARENT);

我不明白为什么 setImeOptions 不起作用! setBackgroundColor 工作正常。 与 setTextSize 相同。我已经:

private Vector<TextView> ranking = new Vector<TextView>();
...
for(int i = 0; i < 5; i++){
    ranking.add(new TextView(this));
    ranking.lastElement().setTextSize(30);
}

但文字大小不会改变。

【问题讨论】:

标签: android textview ime


【解决方案1】:

正如这里指出的:setImeOptions: why the "Done" button does not show on the soft keyboard? 在 TextEdit 上调用 setSingleLine() 将启用该功能。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-13
    • 2018-03-16
    • 1970-01-01
    • 1970-01-01
    • 2021-08-28
    • 2013-02-26
    相关资源
    最近更新 更多