java中的Ad xmlns属性

时间:2012-08-21 14:46:51

标签: android xml xml-namespaces

我目前正在将xml文件转换为java编码,但我遇到了一个问题。在我的xml文件中,我有一个带有两个xmlns属性的View,如下所示:

xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"

如何在java中将这些广告添加到我的自定义FrameLayout?

1 个答案:

答案 0 :(得分:1)

xmlns属性的目的是告诉关于各种UI元素的设计时和构建时工具,例如ButtonTextViewFrameLayout

如果您正在编写Java代码以动态构建布局,那么只需导入相关的小部件和视图类就基本上是等效的。换句话说,不要担心xmlns属性。