Rendering Problems: java.lang.NullPointerException at android.support.v7.widget.RecyclerView in Android Studio 1.1.0

后端 未结 6 746
忘掉有多难
忘掉有多难 2020-12-31 03:32

I have recently updated android sdk to api 22 and android studio 1.1.0. After that I am getting rendering issues on RecyclerView. Here is what I am getting

          


        
6条回答
  •  礼貌的吻别
    2020-12-31 04:27

    My problem was solved when I took out this line from the xml file for the RecyclerView:

    android:scrollbars="vertical"
    

    I am using the following dependencies:

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:22.0.0'
        compile 'com.android.support:recyclerview-v7:22.0.0'
        compile 'com.android.support:cardview-v7:22.0.0'
    }
    

    EDIT: The root of this issue was pointed out by commentators on this solution - to solve the problem, you can just ensure that the LayoutManager for the RecyclerView is set before you display the RecyclerView with the scrollbars property set.

提交回复
热议问题