Android 对类com.sothree.slidinguppanel.slidinguppannellayout进行充气时出错
我正在我的项目中使用,但当我尝试运行应用程序时,引发了一个Android 对类com.sothree.slidinguppanel.slidinguppannellayout进行充气时出错,android,Android,我正在我的项目中使用,但当我尝试运行应用程序时,引发了一个InflateException android.view.InflateException: Binary XML file line #1: Error inflating class com.sothree.slidinguppanel.SlidingUpPanelLayout 这是我的布局 <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:android
InflateException
android.view.InflateException: Binary XML file line #1: Error inflating class com.sothree.slidinguppanel.SlidingUpPanelLayout
这是我的布局
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_main"
android:layout_gravity="bottom">
<CalendarView
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- other layout -->
</RelativeLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
我做错了什么?根据前面的评论: 根据我所看到的,您可能忘记设置强制属性
android:gravity=“bottom | top”
(选择一个),或者您将其与当前设置的android:layout\u gravity=“bottom”
属性混淆了
正确的重力属性应设置如下:
<com.sothree.slidinguppanel.SlidingUpPanelLayout
...
android:gravity="bottom"
...
>
...
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
...
您能在Logcat中找到strack跟踪吗?总的来说,这里有更多关于到底哪里出了问题的细节。根据我所看到的,看起来你可能忘记了设置强制属性&mdash;&mdash;重力&mdash;&mdash;&mdash;顶部&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;或者你把它与当前设置的属性&mdash;&mdash;&mdash;混合了。我使用自动完成,所以我没有真正注意。你能把你的评论移到答案区吗?这样我就可以标记它了?
<com.sothree.slidinguppanel.SlidingUpPanelLayout
...
android:gravity="bottom"
...
>
...
</com.sothree.slidinguppanel.SlidingUpPanelLayout>