gpt4 book ai didi

java - Umano 的 SlidingUpPanelLayout : Got a weird error in XML when I used it

转载 作者:行者123 更新时间:2023-11-30 03:04:39 25 4
gpt4 key购买 nike

这是错误:

Exception raised during rendering: com.android.layoutlib.bridge.MockView cannot be cast to android.view.ViewGroup
Exception details are logged in Window > Show View > Error Log
The following classes could not be instantiated:
- com.sothree.slidinguppanel.SlidingUpPanelLayout (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse

java.lang.IllegalArgumentException: layout_gravity must be set to either top or bottom
at com.sothree.slidinguppanel.SlidingUpPanelLayout.<init>(SlidingUpPanelLayout.java:239)
at com.sothree.slidinguppanel.SlidingUpPanelLayout.<init>(SlidingUpPanelLayout.java:228)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:-2)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:422)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:179)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:755)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:373)

最初我只是将项目直接克隆到我的计算机上。但是由于我对其进行了更改并希望使用 github 的应用程序来同步更改,因此我将其 fork 并添加到我的项目中。自从在我使用它的 XML 文件中,我得到了这个错误。

最初我只是将项目直接克隆到我的计算机上。但是由于我对其进行了更改并希望使用 github 的应用程序来同步更改,因此我将其 fork 并添加到我的项目中。自从在我使用它的 XML 文件中,我得到了这个错误。

编辑:添加了错误的其余部分。我像这样定义 layout_gravity:

xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/item_photo_pager_sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:background="@color/black"
sothree:collapsedHeight="32dp"
sothree:dragView="@+id/item_photo_pager_like_counter"
sothree:shadowHeight="4dp" >

最佳答案

我傻了

android:layout_gravity="bottom"

实际上应该是

android:gravity="bottom"

关于java - Umano 的 SlidingUpPanelLayout : Got a weird error in XML when I used it,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22001546/

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