LayoutInflater. inflate () parameter, inflater. inflate Parameter
Reference connection: http://blog.csdn.net/lovexieyuan520/article/details/9036673
Http://www.2cto.com/kf/201407/313054.html
Http://blog.csdn.net/xyz_fly/article/details/37932989
Http://blog.jobbole.com/72156/
There are four inflate Methods: This method reloads four call methods:
1. public View inflate (int resource, ViewGroup root)
2. public View inflate (int resource, ViewGroup root, boolean attachToRoot)
3. public View inflate (XmlPullParser parser, ViewGroup root)
4. public View inflate (XmlPullParser parser, ViewGroup root, boolean attachToRoot)
The fourth method is called.
1. If root is empty, the current layout does not work. Use the root layout settings.
2 when root is not empty (root) and attachToRoot is false, the layout settings can be used. When attachToRoot is true, the layout is added to (if the root layout is vertical) (Mount ?) In the root layout, and keep its own layoutparam parameter (that is, the parameter settings of the layout ).
Summary on the first floor:
True: and root exists. Mount xml to root and return root.
False: returns the xml layout.