Shane
Shane

Reputation: 2629

Any way to avoid "android:" statements in Android XML layout file?

Is there any way to avoid hundreds of "android:" statements in an Android XML layout file? I am new to Android and I find the "android:" statements make layouts very hard to read. Plus they are a pain to constantly type.

For example, instead of this:

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2" 

I would like to just see this:

layout_width="wrap_content"
layout_height="wrap_content"
layout_column="2"

Upvotes: 1

Views: 82

Answers (2)

codeMagic
codeMagic

Reputation: 44571

No. That is needed to know it is part of the Android framework. Instead of say a custom style or custom View. I've done a little bit of Android coding and it really isn't a big deal.

For example, there is a copy/paste feature which can make it go faster. Also, most IDEs have autocomplete which is very handy.

Upvotes: 1

Philio
Philio

Reputation: 4185

If you're using Eclipse (and presumably Android Studio has similar functionality, but I've not used it) you can auto complete layout properties, e.g. if you type w then ctrl + space it will auto complete this to android:layout_width in most instances. You never really need to type the android: part.

I'm not aware of a way to remove the namespaces.

Upvotes: 1

Related Questions