gpt4 book ai didi

android - Activity 中的透明面板

转载 作者:行者123 更新时间:2023-11-29 22:23:26 25 4
gpt4 key购买 nike

我正在尝试使用 this 设置透明面板我的应用程序中的教程,但每当我在我的 Activity 中使用以下 xml 时,它都会强制关闭

  <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/home_container"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<com.google.android.maps.MapView
android:id="@+id/city_map_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="0DUEIIn35xtmC6Vk1JkFEF74kwkUjgb7HrUMKfA"/>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="bottom"
android:paddingLeft="5px"
android:paddingTop="5px"
android:paddingRight="5px">

<com.pocketjourney.view.TransparentPanel
android:id="@+id/transparent_panel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="5px"
android:paddingLeft="5px"
android:paddingBottom="5px"
android:paddingRight="5px">

<Button android:id="@+id/button_click_me"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click Me!"/>

</com.pocketjourney.view.TransparentPanel>

</LinearLayout>
</FrameLayout>

谢谢

日志

07-04 00:14:09.874: DEBUG/ddm-heap(3005): Got feature list request
07-04 00:14:09.974: DEBUG/dalvikvm(55): GC freed 315 objects / 12176 bytes in 264ms
07-04 00:14:10.004: WARN/dalvikvm(101): disableGcForExternalAlloc: false
07-04 00:14:10.084: WARN/dalvikvm(3005): Unable to resolve superclass of Lcom/droidnova/android/howto/optionmenu/ControlMenu; (69)
07-04 00:14:10.084: WARN/dalvikvm(3005): Link of class 'Lcom/droidnova/android/howto/optionmenu/ControlMenu;' failed
07-04 00:14:10.094: DEBUG/AndroidRuntime(3005): Shutting down VM
07-04 00:14:10.094: WARN/dalvikvm(3005): threadid=3: thread exiting with uncaught exception (group=0x4001e390)
07-04 00:14:10.104: ERROR/AndroidRuntime(3005): Uncaught handler: thread main exiting due to uncaught exception
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.droidnova.android.howto.optionmenu/com.droidnova.android.howto.optionmenu.ControlMenu}: java.lang.ClassNotFoundException: com.droidnova.android.howto.optionmenu.ControlMenu in loader dalvik.system.PathClassLoader@448a0d70
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2497)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.app.ActivityThread.access$2200(ActivityThread.java:126)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.os.Handler.dispatchMessage(Handler.java:99)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.os.Looper.loop(Looper.java:123)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.app.ActivityThread.main(ActivityThread.java:4595)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at java.lang.reflect.Method.invokeNative(Native Method)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at java.lang.reflect.Method.invoke(Method.java:521)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at dalvik.system.NativeStart.main(Native Method)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): Caused by: java.lang.ClassNotFoundException: com.droidnova.android.howto.optionmenu.ControlMenu in loader dalvik.system.PathClassLoader@448a0d70
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2489)

现在我明白了

07-04 00:28:31.914: ERROR/ActivityManager(101): fail to set top app changed!

最佳答案

XML 声明

说在包 com/pocketjourney/view 中会有一个名为 TransparentPanel 的类

所以我假设你的包不是那个,你会自己命名它所以你需要更新你的 XML

com.your.package.TransparentPanel

关于android - Activity 中的透明面板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6565806/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com