我正在使用 Androidplot,并且我的 xml 文件中有以下内容:
<com.androidplot.xy.XYPlot
android:id="@+id/dynamicXYPlot"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
androidplot.renderMode="use_background_thread"
androidPlot.title="A Dynamic XY Plot"
androidPlot.domainLabel="Domain"
androidPlot.rangeLabel="Range"
androidPlot.titleWidget.labelPaint.textSize="@dimen/title_font_size"
androidPlot.domainLabelWidget.labelPaint.textSize="@dimen/domain_label_font_size"
androidPlot.rangeLabelWidget.labelPaint.textSize="@dimen/range_label_font_size"
androidPlot.graphWidget.marginTop="20dp"
androidPlot.graphWidget.marginLeft="15dp"
androidPlot.graphWidget.marginBottom="25dp"
androidPlot.graphWidget.marginRight="10dp"
androidPlot.graphWidget.rangeLabelPaint.textSize="@dimen/range_tick_label_font_size"
androidPlot.graphWidget.rangeOriginLabelPaint.textSize="@dimen/range_tick_label_font_size"
androidPlot.graphWidget.domainLabelPaint.textSize="@dimen/domain_tick_label_font_size"
androidPlot.graphWidget.domainOriginLabelPaint.textSize="@dimen/domain_tick_label_font_size"
androidPlot.legendWidget.textPaint.textSize="@dimen/legend_text_font_size"
androidPlot.legendWidget.iconSizeMetrics.heightMetric.value="15dp"
androidPlot.legendWidget.iconSizeMetrics.widthMetric.value="15dp"
androidPlot.legendWidget.heightMetric.value="25dp"
androidPlot.legendWidget.positionMetrics.anchor="right_bottom"
androidPlot.graphWidget.gridLinePaint.color="#000000"/>
但它说:未知属性 androidplot
为什么 Android Studio 无法识别 androidplot 属性?
请注意,我已将 .jar 文件插入到 libs 目录中,并将其添加为库!
最佳答案
我通过将其添加到我的 xml 中解决了这个问题:
xmlns:androidplot="http://schemas.android.com/apk/lib/com.example.applicationname"
并在所有 androidplot 的引用前面添加“androidplot:”,例如:
androidplot:androidPlot.domainLabel="Domain"
关于android - 为什么 Android Studio 无法识别我的 xml 中的 androidplot 属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32285235/