美文网首页
xml布局转化为View小结

xml布局转化为View小结

作者: dev晴天 | 来源:发表于2018-08-11 18:36 被阅读0次
1 View.inflate(Context,R.layout.Demo,root);

2 Layoutinflate.from(Context).inflate(R.layout.Demo,root);

3 Layoutinflate iflate = getSystemservice(LAYOUT_INFLATE_SERVICE);
  iflate .inflate(R.layout.Demo,root);


// 实际开发中 第三个常用(谷歌源码中arrayadpter  simpleAdapter 中采用的这种  )
//注 1与23的差异在recyclerView中就有差异 条目不居中问题 

相关文章

网友评论

      本文标题:xml布局转化为View小结

      本文链接:https://www.haomeiwen.com/subject/qrndbftx.html