• Android 一些基本组件的使用


    Dialog

    基本用法 ,带自定义view

    AlertDialog dialog = new AlertDialog.Builder(context).setTitle("写入信息")
                    .setView(view)
                    .setPositiveButton("确认", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
    
                        }
                    }).setNegativeButton("取消", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
    } }) .create(); dialog.show();

    自定义 Adapter 

        public final class ViewHolder {
            public TextView describe;
            public TextView username;
            public TextView password;
        }
      @Override
        public View getView(int position, View convertView, ViewGroup parent) {
    
            ViewHolder holder=null;
            if (convertView==null){
                holder = new ViewHolder();
                convertView=mInflater.inflate(R.layout.adapter_account_item,null);
                holder.describe=(TextView)convertView.findViewById(R.id.describe);
                holder.username=(TextView)convertView.findViewById(R.id.username);
                holder.password=(TextView)convertView.findViewById(R.id.password);
                convertView.setTag(holder);
            }else{
                holder = (ViewHolder) convertView.getTag();
            }
            holder.describe.setText(listdata.get(position).getDescribe());
            holder.username.setText(listdata.get(position).getAccount());
            holder.password.setText(listdata.get(position).getPassword());
    
            return convertView;
        }
  • 相关阅读:
    swagger生成接口文档
    二分查找通用模板
    go-json技巧
    【Go】获取用户真实的ip地址
    数据库储存时间类型
    密码加密:md5/sha1 +盐值
    参数里时间格式的转换
    不好定位的元素定位
    vim编辑器
    ps -ef | grep php kill -9
  • 原文地址:https://www.cnblogs.com/baokang/p/4970091.html
Copyright © 2020-2023  润新知