码迷,mamicode.com
首页 > 其他好文 > 详细

LayoutInflater的用法

时间:2017-09-02 18:11:02      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:ssi   time   youdao   inf   parse   ring   string   figure   process   

Instantiates a layout XML file into its corresponding View objects. It is never used directly. Instead, use getLayoutInflater() or getSystemService(String) to retrieve a standard LayoutInflater instance that is already hooked up to the current context and correctly configured for the device you are running on. For example
LayoutInflater inflater = (LayoutInflater)context.getSystemService
(Context.LAYOUT_INFLATER_SERVICE);
For performance reasons, view inflation relies heavily on pre-processing of XML files that is done at build time. Therefore, it is not currently possible to use LayoutInflater with an XmlPullParser over a plain XML file at runtime; it only works with an XmlPullParser returned from a compiled resource (R.something file.)

LayoutInflater的用法

标签:ssi   time   youdao   inf   parse   ring   string   figure   process   

原文地址:http://www.cnblogs.com/ouyangping/p/7466976.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!