android.widget.TextView.setImeOptions()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中android.widget.TextView.setImeOptions()方法的一些代码示例,展示了TextView.setImeOptions()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.setImeOptions()方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:setImeOptions

TextView.setImeOptions介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

Dialog createDialog () {
  textView = createView(context);
  textView.setOnKeyListener(this);
  FrameLayout.LayoutParams textBoxLayoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
    FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
  textView.setLayoutParams(textBoxLayoutParams);
  textView.setFocusable(true);
  textView.setFocusableInTouchMode(true);
  textView.setImeOptions(textView.getImeOptions() | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
  final FrameLayout layout = new FrameLayout(context);
  ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0);
  layout.setLayoutParams(layoutParams);
  layout.addView(textView);
  layout.setOnTouchListener(this);
  dialog = new Dialog(context, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
  dialog.setContentView(layout);
  return dialog;
}

代码示例来源:origin: libgdx/libgdx

Dialog createDialog () {
  textView = createView(context);
  textView.setOnKeyListener(this);
  FrameLayout.LayoutParams textBoxLayoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
    FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
  textView.setLayoutParams(textBoxLayoutParams);
  textView.setFocusable(true);
  textView.setFocusableInTouchMode(true);
  textView.setImeOptions(textView.getImeOptions() | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
  final FrameLayout layout = new FrameLayout(context);
  ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0);
  layout.setLayoutParams(layoutParams);
  layout.addView(textView);
  layout.setOnTouchListener(this);
  dialog = new Dialog(context, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
  dialog.setContentView(layout);
  return dialog;
}

代码示例来源:origin: drawers/SpinnerDatePicker

/**
 * Sets the IME options for a spinner based on its ordering.
 *
 * @param spinner      The spinner.
 * @param spinnerCount The total spinner count.
 * @param spinnerIndex The index of the given spinner.
 */
private void setImeOptions(NumberPicker spinner, int spinnerCount, int spinnerIndex) {
  final int imeOptions;
  if (spinnerIndex < spinnerCount - 1) {
    imeOptions = EditorInfo.IME_ACTION_NEXT;
  } else {
    imeOptions = EditorInfo.IME_ACTION_DONE;
  }
  TextView input = NumberPickers.findEditText(spinner);
  input.setImeOptions(imeOptions);
}

代码示例来源:origin: lany192/DateTimePicker

/**
 * Sets the IME options for a NPicker based on its ordering.
 *
 * @param NPicker      The NPicker.
 * @param NPickerCount The total NPicker count.
 * @param NPickerIndex The index of the given NPicker.
 */
private void setImeOptions(NumberPicker NPicker, int NPickerCount, int NPickerIndex) {
  final int imeOptions;
  if (NPickerIndex < NPickerCount - 1) {
    imeOptions = EditorInfo.IME_ACTION_NEXT;
  } else {
    imeOptions = EditorInfo.IME_ACTION_DONE;
  }
  TextView input = NPicker.findViewById(R.id.number_picker_edit_text);
  input.setImeOptions(imeOptions);
}

代码示例来源:origin: lany192/DateTimePicker

/**
 * Sets the IME options for a NPicker based on its ordering.
 *
 * @param NPicker      The NPicker.
 * @param NPickerCount The total NPicker count.
 * @param NPickerIndex The index of the given NPicker.
 */
private void setImeOptions(NumberPicker NPicker, int NPickerCount,
              int NPickerIndex) {
  final int imeOptions;
  if (NPickerIndex < NPickerCount - 1) {
    imeOptions = EditorInfo.IME_ACTION_NEXT;
  } else {
    imeOptions = EditorInfo.IME_ACTION_DONE;
  }
  TextView input = (TextView) NPicker
      .findViewById(R.id.number_picker_edit_text);
  input.setImeOptions(imeOptions);
}

代码示例来源:origin: lany192/DateTimePicker

/**
 * Sets the IME options for a NPicker based on its ordering.
 *
 * @param NPicker      The NPicker.
 * @param NPickerCount The total NPicker count.
 * @param NPickerIndex The index of the given NPicker.
 */
private void setImeOptions(NumberPicker NPicker, int NPickerCount,
              int NPickerIndex) {
  final int imeOptions;
  if (NPickerIndex < NPickerCount - 1) {
    imeOptions = EditorInfo.IME_ACTION_NEXT;
  } else {
    imeOptions = EditorInfo.IME_ACTION_DONE;
  }
  TextView input = (TextView) NPicker
      .findViewById(R.id.number_picker_edit_text);
  input.setImeOptions(imeOptions);
}

代码示例来源:origin: Tencent/RapidView

((TextView)view).setImeOptions(options);

代码示例来源:origin: stackoverflow.com

input.setImeOptions(imeOptions);

代码示例来源:origin: jelic98/dynamico

textView.setImeOptions(EditorInfo.IME_ACTION_DONE);
}else if(options.equalsIgnoreCase("go")) {
  textView.setImeOptions(EditorInfo.IME_ACTION_GO);
}else if(options.equalsIgnoreCase("next")) {
  textView.setImeOptions(EditorInfo.IME_ACTION_NEXT);
}else if(options.equalsIgnoreCase("none")) {
  textView.setImeOptions(EditorInfo.IME_ACTION_NONE);
}else if(options.equalsIgnoreCase("previous")) {
  textView.setImeOptions(EditorInfo.IME_ACTION_PREVIOUS);
}else if(options.equalsIgnoreCase("search")) {
  textView.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
}else if(options.equalsIgnoreCase("send")) {
  textView.setImeOptions(EditorInfo.IME_ACTION_SEND);
}else if(options.equalsIgnoreCase("unspecified")) {
  textView.setImeOptions(EditorInfo.IME_ACTION_UNSPECIFIED);

相关文章

TextView类方法