1
我創建了一個擴展了RecyclerView.Adapter的類。我使用android.R.layout.simple_list_item_1。用butterknife綁定視圖在android.R.layout.simple_list_item_1
在我ViewHolder,我試圖映射它的TextView 的text1上一個TextView變量,使用這樣的:
myTextView = (TextView) itemView.findViewById(android.R.id.text1);
這就像一個魅力,但我還使用butterknife,據當我搜索時,我無法在任何地方傳遞android.R.id.text1。
什麼我tryed至今:
@BindView(android.R.id.text1)
TextView myTextView;
而且,我ViewHolder的構造函數:
private ViewHolder(View itemView) {
super(itemView);
myTextView = ButterKnife.findById(itemView, android.R.id.text1);
}
有沒有一種方法,使其與ButterKnife工作?
這是不行的,在我的問題提到:\ – LeonardoSibela
我的朋友,它的工作UU 我對不起,這樣一個不必要的答案會讓你失去時間。 感謝您的幫助 – LeonardoSibela
我的解決方案工作? –