【发布时间】:2011-04-26 02:30:50
【问题描述】:
这应该是相当简单的任务。我有以下看法:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:panel="org.miscwidgets"
<org.miscwidgets.widget.Panel
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="right"
panel:handle="@+id/panelHandle"
panel:content="@+id/panelContent"
panel:position="right">
我正在尝试访问视图构造函数中的位置属性,但它始终返回 null。
String posVal = attrs.getAttributeValue("schemas.android.com/apk/gen/org.miscwidgets", "position");
如何获得价值?我的命名空间错了吗?
我看到了对 Styleables 的引用,但我没有找到任何未被弃用的内容。
【问题讨论】:
标签: java android view namespaces