如何自定义在 EditTextView 的 IME 操作按钮中显示的文本。我尝试使用 setImeActionLabel 但它不起作用。
public class TestIMEActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
final EditText ed1 = new EditText(this);
ed1.setSingleLine(true);
ed1.setImeActionLabel("test", 0);
layout.addView(ed1, params);
setContentView(layout);
}
}