zoukankan      html  css  js  c++  java
  • 改装原生的dialog

    改装 dialog 定制

    View rootView = LayoutInflater.from(mContext).
    inflate(R.layout.nfc_tag_name_dialog, null, false);
    final EditText etTagName = (EditText) rootView.findViewById(R.id.et_nfctag_name);
    String datetime = DateUtils.currentTimeStringNew().replaceAll(":","-");
    etTagName.setText(datetime);
    etTagName.setSelection(etTagName.getText().length());  //光标位置
    AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
    builder.setTitle(getString(R.string.tag_dialog_name));
    builder.setView(rootView);
    builder.setPositiveButton(R.string.action_ok, null
    );
    builder.setNegativeButton(R.string.action_cancel, new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {

    }
    });

    final AlertDialog alertDialog = builder.create();
    alertDialog.show();
    alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener();

  • 相关阅读:
    性能优化
    几种跨域处理
    重温前端基础之-数组去重
    移动端常遇到的问题
    WPF 应用
    WPF 应用
    WPF 应用
    C# 应用
    WPF 应用
    C# 应用
  • 原文地址:https://www.cnblogs.com/spps/p/8761053.html
Copyright © 2011-2022 走看看