【问题标题】:anastr issue - why the speedView does not show up in the studio layout editor?anastr 问题 - 为什么 speedView 没有出现在工作室布局编辑器中?
【发布时间】:2019-12-29 01:31:08
【问题描述】:

我使用的是 1.3.0。

代码按预期运行,但为什么我在布局编辑器中看不到对象?我尝试过使用 RelativeLayout 和 ConstraintLayout。

当我使用库时,在布局编辑器中集成特定项目小部件有什么魔力?

我尝试过干净的项目,与 gradle 同步并构建。 缺少什么?

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
<com.github.anastr.speedviewlib.SpeedView
    android:id="@+id/speedView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

【问题讨论】:

  • 只是为了测试用一些"100dp"替换&lt;com.github.anastr.speedviewlib.SpeedView中的"wrap_content",有什么区别吗?
  • 没有区别。我想知道什么?表示在组件树中(快照)?
  • ? 是什么意思?
  • 查看快照:在组件树中它显示了 speedView 对象。有一个?这让我觉得我错过了整合中的一些东西。在“添加对象”中相同,我搜索 SpeedView 但没有找到?
  • 整合?在&lt;com.github.anastr.speedviewlib.SpeedView 中将鼠标移动到SpeedView 部分并执行Ctrl-left click,它会转到SpeedView 来源吗?

标签: android android-layout android-studio


【解决方案1】:

这是一个旧错误,已在接下来的几个版本中修复,如果仍有此问题,请移至latest release

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多