在android布局文件中,经常可以看到如下的写法:
xmlns:android="http://schemas.android.com/apk/res/android"
其中,
xmlns:android其实是一个命名空间,我们在布局文件中便可以使用android来代替
http://schemas.android.com/apk/res/android我们常用的布局可以改为如下文件:
<pre name="code" class="html"><RelativeLayout xmlns:test="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
test:layout_width="match_parent"
test:layout_height="match_parent"
tools:context="${packageName}.${activityClass}" >
<SeekBar
test:layout_centerInParent="true"
test:layout_width="wrap_content"
test:layout_height="match_parent" />
</RelativeLayout>