2
A
回答
2
請參閱更新2獲得最佳解決方案!
我想我有同樣的問題。爲了更好地理解,我在一張照片中描述了它。我希望能跟大家能提供Namratha和我一些幫助......
(哦,我只注意到,該ImageUploader搞砸了我的圖畫文字,它會說:「我想建菜單下拉到我的應用程序。它應該就是這樣的例子。「)
UDPATE
感謝雅努什,誰告訴我,我應該尋找什麼。
出於某種原因,我總是在我的Eclipse佈局預覽出現此錯誤:
java.lang.IllegalArgumentException: The handle attribute is required and must refer to a valid child.
at android.widget.SlidingDrawer.<init>(SlidingDrawer.java:204)
at android.widget.SlidingDrawer.<init>(SlidingDrawer.java:181)
at sun.reflect.GeneratedConstructorAccessor204.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at android.view.LayoutInflater.createView(LayoutInflater.java:499)
at android.view.BridgeInflater.onCreateView(BridgeInflater.java:77)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:122)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:296)
at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:377)
at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.computeLayout(Unknown Source)
at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.recomputeLayout(Unknown Source)
at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.activated(Unknown Source)
at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.pageChange(Unknown Source)
at org.eclipse.ui.part.MultiPageEditorPart$2.widgetSelected(MultiPageEditorPart.java:290)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3776)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1187)
at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:2743)
at org.eclipse.swt.custom.CTabFolder.destroyItem(CTabFolder.java:500)
at org.eclipse.swt.custom.CTabItem.dispose(CTabItem.java:126)
at org.eclipse.ui.part.MultiPageEditorPart.removePage(MultiPageEditorPart.java:1039)
at org.eclipse.ui.forms.editor.FormEditor.removePage(FormEditor.java:368)
at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.showEditorInput(Unknown Source)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2847)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2768)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2760)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2711)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2707)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2691)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2682)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:365)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:168)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:229)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:208)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)
at org.eclipse.jdt.internal.ui.navigator.OpenAndExpand.run(OpenAndExpand.java:49)
at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:221)
at org.eclipse.ui.navigator.CommonNavigatorManager$3.open(CommonNavigatorManager.java:185)
at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:845)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:843)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1131)
at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:462)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1235)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:264)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:258)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:298)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3776)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1187)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3622)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3277)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
是這樣的佈局XML。我只是刪除了繪製資源指針...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayoutTesting"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="bottom">
<SlidingDrawer
android:layout_width="wrap_content"
android:id="@+id/SlidingDrawer"
android:handle="@+id/slideHandleButton"
android:content="@+id/contentLayout"
android:padding="10dip"
android:layout_height="250dip">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/slideHandleButton"></Button>
<LinearLayout
android:layout_width="wrap_content"
android:id="@+id/contentLayout"
android:orientation="vertical"
android:gravity="center|top"
android:padding="10dip"
android:background="#C0C0C0"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Content"></Button>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Content"></Button>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Content"></Button>
</LinearLayout>
</SlidingDrawer>
</LinearLayout>
更新2
只注意到,有一個better solution我。因爲SlidingDrawer Widget只支持從底部滑動到頂部。我的第一個更新的錯誤仍然存在。
0
用於這種佈局的小部件是Sliding Drawer。您只需爲句柄定義一個佈局,併爲抽屜的內容定義一個佈局。現在,您可以聽取抽屜打開,滾動或關閉等事件。
+0
非常感謝!然而,不知何故,我總是得到這個錯誤:java.lang.IllegalArgumentException:句柄屬性是必需的,必須引用一個有效的孩子。 (請參閱我的更新瞭解詳情) – OneWorld 2010-11-01 10:29:46
相關問題
- 1. 如何創建滑動菜單中的所有活動
- 2. 如何創建Alloy UI下拉菜單
- 3. 如何創建下拉菜單
- 4. 如何用php創建下拉菜單?
- 5. 如何創建一個下拉菜單?
- 6. 如何創建輸入下拉菜單?
- 7. 如何創建下拉漢堡菜單
- 8. 如何創建多列下拉菜單?
- 9. 如何用php創建下拉菜單
- 10. 如何防止導航抽屜菜單單擊時的重新創建活動
- 11. 如何爲彈出菜單創建子菜單?
- 12. 如何重新創建Foundation 6中的Foundation 5下拉菜單?
- 13. 新活動 - 新菜單
- 14. web2py創建下拉菜單layout.html菜單
- 15. 如何在我的活動中創建Facebook一樣的菜單?
- 16. 如何刷新創建活動?如何刷新活動
- 17. Android創建下拉菜單
- 18. 創建下拉菜單
- 19. CSS,創建下拉菜單
- 20. Android創建下拉菜單
- 21. 如何動態創建ReactJs下拉菜單的選項?
- 22. 創建wordpress激活菜單
- 23. 如何創建將存儲當前活動菜單的服務?
- 24. 爲單個下拉菜單創建兒童子菜單
- 25. 如何用數據庫下拉菜單創建導航菜單?
- 26. 如何在html/css中創建下拉菜單登錄菜單
- 27. 如何用下拉菜單創建這個水平菜單?
- 28. 如何在下拉菜單中創建子菜單(HTML/CSS)
- 29. 如何使用子菜單創建下拉菜單?
- 30. 如何製作動態下拉菜單?
什麼是「拔出菜單」? – CommonsWare 2010-07-11 13:47:26
我不明白你的問題。 您可以在http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=summary – Macarse 2010-07-11 13:51:34
獲取Google在camrecorder應用程序中的內置版本。我的意思是,當您不是點擊而是將您的手指在GUI小部件上並進行拉動操作。 該操作會釋放一個菜單。 此行爲與Google攝像機應用中設置菜單發生的情況相同。 – Namratha 2010-07-12 03:38:29