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();

  • 相关阅读:
    HTML 页面的 批量删除的按钮
    HTML 选择器
    ....
    java 反射机制
    插件库
    向上滚动
    浮动元素定位float
    中文字体对应的英文名称
    echarts入门教程
    ie9浏览器window.openbug
  • 原文地址:https://www.cnblogs.com/spps/p/8761053.html
Copyright © 2011-2022 走看看