Android通过代码获取View

View view = LayoutInflater.from(mContext).inflate(R.layout.song_item_adapter, null);

LayoutInflater inflater = (LayoutInflater)context.getSystemService

      Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.hello,null);
 
原文地址:https://www.cnblogs.com/lvlv/p/3754405.html