2016-02-13 49 views
0

我最近添加this GitHub庫在我的Android項目,所以我繼續添加我的gradle這個依賴它看起來像這樣:爲什麼外部CustomViews有紅色鎖?

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' 
} 

當我把一個自定義視圖,如果我用一個與它的greenlock好吧,但當我把一個與紅鎖給我的「渲染問題」的錯誤。

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

¿我應該已經做什麼?

回答

1

您無法使用該依賴關係進行任何操作。 我們可以採取的示例:

InternalEditText in EditText 

這意味着InternalEditText是一個內部類的EditText的。紅色鎖意味着它是私人類,所以EditText類的結構是:

public class EditText { 
    private class InternalEditText { 

    } 
} 

因此,您不能直接訪問該類。

解決方案

  • 反思:不建議,如果你能解決該問題
  • 叉項目:您可以創建在GitHub上項目的叉子和改變公共類
  • 這些類

Btw爲什麼你想要使用這些內部私人類?該項目是有用的前棒棒糖設備上的材料小部件,所以對於EditText(例如),你可以使用com.rey.material.widget.EditText

+1

我會嘗試叉,如果它的工作;那麼你會得到我的正確答案,如果不是,我會做同樣的哈哈,謝謝! :d –

相關問題