我想在运行时为 Android 平台的 Misc 小部件创建一个面板。
XmlPullParser parser = getResources().getXml(R.xml.panel_attribute);
AttributeSet attributes = Xml.asAttributeSet(parser);
Panel panel = (Panel) new Panel(getActivity(),attributes);
panel_attribute.xml 应该是什么?
面板应如下所示
<org.miscwidgets.widget.Panel
xmlns:panel="http://schemas.android.com/apk/res/org.miscwidgets"
android:id="@+id/topPanel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="4dip"
panel:animationDuration="1000"
panel:closedHandle="@drawable/sliding_drawer_handle_minimized"
panel:content="@+id/searchparams_layout"
panel:handle="@+id/handle"
panel:linearFlying="true"
panel:openedHandle="@drawable/sliding_drawer_handle_minimized"
panel:position="top" />