What is the design advantage to do this
<TextView
android:layout_width="105px"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
and not this
<android:TextView
layout_width="105px"
layout_height="wrap_content"
text="@string/hello"
/>
Is that android: prefix everywhere not a little bit to chatty?
android is a namespace prefix and it is used to tell that those attributes are in the XML namespace bound to that prefix. You should have a namespace declaration somewhere in your XML document which looks like xmlns:android = "the namespace URI here". It is quite unusual to prefix attributes but it is necessary when attributes of a given XML vocabulary are found in XML elements not belonging to that vocabulary because it avoids collisions.
In XML, attributes have to be prefixed in order to be in a namespace; they don't automatically pick up the namespace of the element.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With