代码之家  ›  专栏  ›  技术社区  ›  Robert Lewis

Setter需要不支持类型的参数:com.androidplot.ui.widget.TextLabelWidget类

  •  0
  • Robert Lewis  · 技术社区  · 7 年前

    我正在尝试将快速启动示例改编为我的应用程序,但到目前为止,我遇到了以下错误: Error inflating XML (class com.androidplot.xy.XYPlot): Setter requires param of unsupported type: class com.androidplot.ui.widget.TextLabelWidget setContentView( R.layout.activity_graph ); 我的声明 onCreate() line_point_formatter_with_labels.xml

    XYPlot 我的布局文件中的项:

    <com.androidplot.xy.XYPlot
        android:id="@+id/temp_history"
        style="@style/APDefacto.Dark"
        androidPlot.domainTitle="min"
        androidPlot.lineLabelRotationBottom="-45"
        androidPlot.lineLabels="left|bottom"
        androidPlot.rangeTitle="°F"
        androidPlot.title="Temp History"
        android:layout_width="0dp"
        android:layout_height="300dp"
        app:layout_constraintBottom_toTopOf="@id/temp_button"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:layout_margin="36dp" />
    

    所有的 androidPlot 条目已标记 unknown attribute

    1 回复  |  直到 7 年前
        1
  •  0
  •   Robert Lewis    7 年前

    发现问题:我错过了 xmlns:ap 布局文件中的项。我一直只在布局文件的根元素中看到它们,没有意识到它们也可以出现在子视图元素中。它出现在示例代码中,但我只是错过了它。

    推荐文章