"In general, the XML vocabulary for declaring UI elements closely follows the structure and
naming of the classes and methods, where element names correspond to class names and
attribute names correspond to methods. In fact, the correspondence is often so direct that you can
guess what XML attribute corresponds to a class method, or guess what class corresponds to a
given xml element"
"Each layout file must contain exactly one root element, which must be a View or ViewGroup
My Question is this : Why in XML layout files in res folder that i have seen there are no View or ViewGroup root element ???
Like this XML layout file :
posted 3 years ago
LinearLayout extends ViewGroup (as do all the other layout), so it is a ViewGroup for the purposes of a layout file. By that rationale, it is actually superfluous to mention ViewGroup there, because ViewGroup extends View - but maybe abstracting over two levels was too much for the documentation authors :-)
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads