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

x33g5p2x  于2022-01-18 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(217)

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

EditText.setImeOptions介绍

暂无

代码示例

代码示例来源:origin: rey5137/material

/**
 * Change the editor type integer associated with the text view, which
 * will be reported to an IME with {@link EditorInfo#imeOptions} when it
 * has focus.
 * @see #getImeOptions
 * @see EditorInfo
 * @attr ref android.R.styleable#TextView_imeOptions
 */
public void setImeOptions (int imeOptions){
  mInputView.setImeOptions(imeOptions);
}

代码示例来源:origin: facebook/litho

editText.setTypeface(typeface, 0);
editText.setGravity(gravity);
editText.setImeOptions(imeOptions);
editText.setFocusable(editable);
editText.setFocusableInTouchMode(editable);

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

urlText.setImeOptions(EditorInfo.IME_ACTION_GO);
urlText.setOnEditorActionListener(new TextView.OnEditorActionListener() {

代码示例来源:origin: facebook/litho

editText.setGravity(gravity);
editText.setImeOptions(imeOptions);
editText.setOnEditorActionListener(editorActionListener);

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

EditText edText = new EditText(this);
     edText .setId(i);
     edText .setLayoutParams(new LinearLayout.LayoutParams(
         LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,
         1f));
         edText .setWidth(100);
     edText .setImeOptions(EditorInfo.IME_ACTION_NEXT);
     edText .setInputType(InputType.TYPE_CLASS_NUMBER);
     edText .setKeyListener(DigitsKeyListener.getInstance());
     edText .setMaxLines(1);
         edText .setOnFocusChangeListener(this);
     edText .setOnEditorActionListener(this);
     edText .addTextChangedListener(this);
         //this linearlayout id is declared inside your xml file
           LinearLayout linear=(LinearLayout)findViewById(R.id.linearLayout1);
           linear.addView(edText );

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

public class MainActivity extends Activity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);

  final EditText etname;

  etname = (EditText) findViewById(R.id.edittext);
  etname.setImeOptions(EditorInfo.IME_ACTION_DONE);

  }
}

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

EditText et1 = (EditText)findViewById(R.id.editText1);
 et1.setImeOptions(EditorInfo.IME_ACTION_NEXT);
 EditText et2 = (EditText)findViewById(R.id.editText2);
 et2.setImeOptions(EditorInfo.IME_ACTION_NEXT);

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

EditText editText = new EditText(this);
editText.setImeOptions(EditorInfo.IME_ACTION_DONE);

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

EditText editText = new EditText(this);
 editText.setInputType(InputType.TYPE_CLASS_TEXT);
 editText.setImeOptions(EditorInfo.IME_ACTION_DONE);

代码示例来源:origin: guofudong/EShop

private void init(Context context) {
  LayoutInflater.from(context).inflate(R.layout.widget_simple_search_view, this);
  ButterKnife.bind(this);
  etQuery.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
  etQuery.setInputType(EditorInfo.TYPE_CLASS_TEXT);
  etQuery.setOnEditorActionListener(this);
  etQuery.addTextChangedListener(this);
}

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

final RadioGroup btn_group = (RadioGroup) findViewById(R.id.btn_group);
final RadioButton btnA = (RadioButton) findViewById(R.id.btnA);
final RadioButton btnB = (RadioButton) findViewById(R.id.btnB);

btn_group.setOnCheckedChangeListener(new OnCheckedChangeListener() {
  @Override
  public void onCheckedChanged(RadioGroup group, int checkedId) {
    final EditText txtSearch = (EditText) findViewById(R.id.edit_text);

    txtSearch.setInputType(InputType.TYPE_NULL);

    if(btnA.isChecked()) {
      txtSearch.setImeOptions(EditorInfo.IME_ACTION_DONE);
    } else {
      txtSearch.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
    }

    txtSearch.setInputType(InputType.TYPE_CLASS_TEXT);
  }
});

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

EditText input = new EditText(context);
input.setImeOptions(EditorInfo.IME_ACTION_DONE);
input.setImeActionLabel("Guess", EditorInfo.IME_ACTION_DONE);

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

EditText view = new EditText(this);
 view.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
 view.setSingleLine(true);

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

EditText input = new EditText(context);
input.setImeOptions(EditorInfo.IME_ACTION_DONE);
input.setImeActionLabel("My Text", EditorInfo.IME_ACTION_DONE);

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

EditText link_name= (EditText) findViewById(R.id.link_name);
link_name.setSingleLine(false);
link_name.setImeOptions(EditorInfo.IME_FLAG_NO_ENTER_ACTION);

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

private void changeInputTypeAndImeOptions(EditText fieldValue, int inputType, int imeOption) {
  if (inputType == InputType.TYPE_NULL) inputType = fieldValue.getInputType();
  fieldValue.setImeOptions(imeOption | EditorInfo.IME_FLAG_NO_FULLSCREEN);
  //Makes the trigger for the imeOptions to change while typing!
  //fieldValue.setInputType(InputType.TYPE_NULL);
  fieldValue.setInputType(inputType);
  InputMethodManager imm = (InputMethodManager)
      mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
  if (imm != null) imm.restartInput(fieldValue);
}

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

alert.setTitle(R.string.WtsOnYourMind);
final EditText input = new EditText(context);
input.setHeight(100);
input.setWidth(340);
input.setGravity(Gravity.LEFT);
input.setImeOptions(EditorInfo.IME_ACTION_DONE);
alert.setView(input);

代码示例来源:origin: zendesk/belvedere

private KeyboardHelper(@NonNull Activity activity) {
  super(activity);
  this.statusBarHeight = getStatusBarHeight();
  setLayoutParams(new ViewGroup.LayoutParams(0, 0));
  inputTrap = new EditText(activity);
  inputTrap.setFocusable(true);
  inputTrap.setFocusableInTouchMode(true);
  inputTrap.setVisibility(View.VISIBLE);
  inputTrap.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
  inputTrap.setInputType(EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES);
  addView(inputTrap);
  final View rootView = activity.getWindow().getDecorView().findViewById(Window.ID_ANDROID_CONTENT);
  rootView.getViewTreeObserver().addOnGlobalLayoutListener(new KeyboardTreeObserver(activity));
}

代码示例来源:origin: kongpengcheng/SmartRetrofit

@Override
  public View onCreateView(View parent, String name, Context context, AttributeSet attrs) {
    AppCompatDelegate delegate = getDelegate();
    View view = delegate.createView(parent, name, context, attrs);
    if (view != null && view instanceof EditText) {
      EditText et = (EditText) view;
      et.setImeOptions(et.getImeOptions() | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
      return et;
    }
    return view;
  }
});

代码示例来源:origin: googlecodelabs/android-topeka

@Override
protected View createQuizContentView() {
  LinearLayout layout = new LinearLayout(getContext());
  layout.setOrientation(LinearLayout.VERTICAL);
  mAnswerOne = createEditText();
  mAnswerOne.setImeOptions(EditorInfo.IME_ACTION_NEXT);
  mAnswerTwo = createEditText();
  mAnswerTwo.setId(R.id.quiz_edit_text_two);
  addEditText(layout, mAnswerOne);
  addEditText(layout, mAnswerTwo);
  return layout;
}

相关文章

微信公众号

最新文章

更多

EditText类方法