zoukankan      html  css  js  c++  java
  • 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;
        }
  • 相关阅读:
    python 网络客户端编程端口,模块
    Python反转
    ASP.NET的路由系统
    yield 关键字
    C# Lock关键字
    C#中as和is关键字
    13.4 上下文对象
    请求生命周期
    ASP.NET常用的指令
    ASP.NET Page 指令
  • 原文地址:https://www.cnblogs.com/baokang/p/4970091.html
Copyright © 2011-2022 走看看