Aleksandr Stserbatski
Aleksandr Stserbatski

Reputation: 31

Android Studio, GridLayout not working properly on API under than 23

When I am trying to preview on API 23 GridLayout working perfectly. However on previous API 21 it is on wrong position and margins or padding not helping. Also target API is 23 minSDK API is 15 and when I am trying to change target API to 21 I have rendering problems(failed to parse file). How to make app compatible with API versions under API 23? I really appreciate any help you can provide.

API 23:
API 23

API 21:
API 21

Upvotes: 2

Views: 1264

Answers (1)

Aleksandr Stserbatski
Aleksandr Stserbatski

Reputation: 31

Solved everything: 1.In the build.gradle (Module: app) added to dependencies dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') androidTestCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:appcompat-v7:+' compile 'com.android.support:gridlayout-v7:23.1.+' }

2.In the actvity_main.xml changed to <android.support.v7.widget.GridLayout>

Upvotes: 1

Related Questions