<分区>
在 github 上有一个用于选项卡菜单的库,我试图将其添加到我的项目中 ( https://github.com/michaldrabik/TapBarMenu )。通过在 xml 文件中包含新对象来使用该库:
<com.michaldrabik.tapbarmenulib.TapBarMenu
android:id="@+id/tapBarMenu"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_gravity="center_horizontal|bottom"
app:tbm_backgroundColor = "@color/colorPrimaryDark"
app:tbm_menuAnchor = "top"
app:tbm_buttonPosition = "left"
android:layout_margin="10dp">
成功了。后来我尝试增加更多的灵 active ,还从库中添加了类 TapBarMenu 并添加了:
<TapBarMenu
android:id="@+id/tapBarMenu02"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_gravity="center_horizontal|bottom"
android:tbm_backgroundColor = "@color/colorPrimaryDark"
app:tbm_menuAnchor = "top"
app:tbm_buttonPosition = "left"
android:layout_margin="10dp">
但是对于第二次包含 Android Studio 说:
app
的“意外 namespace 前缀”,而在 xml 的开头
xmlns:app="http://schemas.android.com/apk/res-auto"
我已阅读 Android 文档 NamespaceContext , 但它相当短。请说明如何在 xml 中使用本地类,并指出阅读有关 Android 命名空间的好地方。