Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/214.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 为什么setImeOptions没有';不行?SettexSize也一样_Android_Textview_Ime - Fatal编程技术网

Android 为什么setImeOptions没有';不行?SettexSize也一样

Android 为什么setImeOptions没有';不行?SettexSize也一样,android,textview,ime,Android,Textview,Ime,我的代码: TextView tv = new TextView(this); final EditText newPositionName = new EditText(this); newPositionName.setImeOptions(EditorInfo.IME_ACTION_SEARCH); newPositionName.setBackgroundColor(Color.TRANSPARENT); 我不明白为什么setImeOptions不起作用!setBackgroundC

我的代码:

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

newPositionName.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
newPositionName.setBackgroundColor(Color.TRANSPARENT);
我不明白为什么setImeOptions不起作用!setBackgroundColor工作正常。 SettexSize也一样。我已经:

private Vector<TextView> ranking = new Vector<TextView>();
...
for(int i = 0; i < 5; i++){
    ranking.add(new TextView(this));
    ranking.lastElement().setTextSize(30);
}
私有向量排名=新向量();
...
对于(int i=0;i<5;i++){
添加(新文本视图(本));
ranking.lastElement().setTextSize(30);
}
但是文本大小不会改变。

正如这里指出的: 在TextEdit上调用
setSingleLine()
将启用该功能。

我发现了这个问题