为什么外部CustomView具有红色锁定?

时间:2016-02-13 19:40:50

标签: android github gradle dependencies

我最近在我的Android项目中添加了this GitHub repo,所以我继续添加我的gradle依赖项,如下所示:

dependencies {

    testCompile 'junit:junit:4.12'



    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.github.rey5137:material:1.2.2'
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
}

当我使用自定义视图时,如果我使用绿色锁定,那就没关系,但当我使用红色锁定时,会出现“渲染问题”错误。

Here is the image of How it looks when I select it from the Custom Views

¿我该怎么办?

1 个答案:

答案 0 :(得分:1)

使用该依赖项无法执行任何操作。 我们可以举一个例子:

InternalEditText in EditText

这意味着InternalEditText是EditText的内部类。红色锁意味着它是一个私有类,因此EditText类的结构是:

public class EditText {
    private class InternalEditText {

    }
}

因此您无法直接访问该课程。

<强>解决方案

  • 反思:如果可以解决问题,不建议使用
  • 项目的分支:您可以在GitHub上创建项目的分支,并在公共类中更改这些类

顺便说一下你为什么要使用那些内部私有类?该项目对于在棒棒糖前设备上使用素材小部件非常有用,因此对于EditText(例如),您可以使用com.rey.material.widget.EditText

相关问题