Search code examples
androidandroid-layoutandroid-gridlayout

Only grey box in Android GridLayout


When I put grid layouts in my xml file, it doesn't do anything but just shows a gray box. Plus, it doesn't have attributes like columnCount or weight. If I drag several view items and put them under the grid layout, I can't see anything.. What should I do here?

enter image description here


Solution

  • Implement below gradle in your build.gradle for GridLayout.

    implementation 'com.android.support:gridlayout-v7:28.0.0-rc02'
    

    after Implement just clean and rebuild your project.