在 XML for AppWidgetProvider 中查看



我有一个XML文件布局,我想在其中添加一条水平线。为此,我添加了以下内容:

<View
    android:layout_width="match_parent"
    android:layout_height="1dp"
    android:background="@android:color/black" />

不幸的是,这个布局被应用程序小部件提供程序使用,我的apk崩溃了以下错误:

W/AppWidgetHostView(  517): updateAppWidget couldn't find any view, using error view
W/AppWidgetHostView(  517): android.view.InflateException: Binary XML file line #25: Error inflating class android.view.View

从那里我不确定如何解决它。我想让我的行显示并出现在我的 XML 中。

谢谢。

使用这个

  <TextView
    android:layout_width="match_parent"
    android:layout_height="1dp"
    android:background="@android:color/black" />

相关内容

  • 没有找到相关文章

最新更新