- LayoutInflater inflater = (LayoutInflater)
- mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
- View view= inflater.inflate(R.layout.custom_dialog,null);
- TextView text = (TextView) view.findViewById(R.id.text); //指定view获取
接着就把view赋值给所需要的容器,比如Dialog的setView(view)。