Reputation:
I'm little confused about ConstraintLayout in Android. I was learning about it and first thing I get confused about it why android use separate xml namespace for it? xmlns:app="http://schemas.android.com/apk/res-auto"
ConstraintLayout is part of Layout then why google didn't added it in the old namespace? xmlns:android="http://schemas.android.com/apk/res/android"
and why android required to write full qualified name in XML? android.support.constraint.ConstraintLayout
why not just ConstraintLayout? as RelativeLayout?
Upvotes: 3
Views: 632
Reputation: 1007399
ConstraintLayout is part of Layout then why google didn't added it in the old namespace?
That is reserved for platform-defined attributes. ConstraintLayout
is from a library, not from the platform.
and why android required to write full qualified name in XML? android.support.constraint.ConstraintLayout why not just ConstraintLayout?
Android only knows to look in a couple of platform-defined packages for views using the shorthand, bare-class-name-only notation. android.support.constraint
is from a library, not the platform.
Upvotes: 4