inflater将一个Layout布局转化为View

将一个Layout布局转化为View有两种方法,其实本质都一样

(1)View.inflate(mContext, R.layout.carepeople_item, null);

(2)LayoutInflater mInflater;
 mInflater = LayoutInflater.from(mContext);
 convertView = mInflater.inflate(R.layout.carepeople_item, null);

也可以合并:convertView = LayoutInflater.from(mContext).inflate(R.layout.carepeople_item, null);

你可能感兴趣的:(inflater将一个Layout布局转化为View)