1)1嵌套的時候,在scrollview的屬性中加入android:fillViewport="true"司忱,允許內(nèi)部的控件充滿它
2)發(fā)現(xiàn)即使xml中設(shè)置了item中文字的位置皇忿,但是運行出來的程序位置還是靠左畴蹭,解決辦法是:在inflate時將parent也傳進(jìn)去
ScrollView can host only one direct child也就是只能有一個子view坦仍,加一層Linearlayout將多個子view包進(jìn)去
3)Attempt to invoke virtual method 'boolean android.support.v7.widget.RecyclerView$LayoutManager.canScrollVertically()' on a null object reference
解決:刪除布局文件中的android:scrollbars="vertical"
4)java.lang.IllegalArgumentException: LayoutManager android.support.v7.widget.LinearLayoutManager@3e4507 is already attached to a RecyclerView: android.support.v7.widget.RecyclerView{df5b634 VFED..... ......I. 0,0-0,0 #7f0b0068 app:id/rv}
也就是說 linearLayoutmanager已經(jīng)attachedto 一個recyclerview了,再有recyclerview需要再建linearlayoumanager
解決:再建一個linearLayoutManager實例叨襟,與另一個recyclerview匹配