Grid layout doesn't work properly on API level 19?
up vote
2
down vote
favorite
I am facing a problem and I have searched a lot about it but couldn't find a solution.
I used a grid layout in my design and it works fine with API level > 19, but when I run my App on API level 19 it doesn't work properly:
Here is a screenshot of my App running on API level > 19:
Screenshot (when API level > 19)
And on API level 19:
Screenshot (when API = 19)
I tried adding these lines to the gradle file but they didn't help:
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'
And here is my layout.xml code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/bg"
android:weightSum="10"
android:padding="10dp"
tools:context=".ui.home.HomeActivity">
<ImageView
android:layout_weight="1"
android:layout_gravity="center"
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="120dp"
app:srcCompat="@drawable/azkar_logo" />
<GridLayout
android:columnCount="2"
android:rowCount="2"
android:alignmentMode="alignMargins"
android:columnOrderPreserved="true"
android:padding="5dp"
android:layout_weight="8"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- Row 1 -->
<!-- Column 1 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startSalah"
android:layout_gravity="center_horizontal"
android:src="@drawable/praying"
android:layout_width="wrap_content"
android:layout_height="90dp" />
<TextView
android:textAlignment="center"
android:text="@string/salah"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
<!-- Column 2 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startQuran"
android:layout_width="wrap_content"
android:layout_height="90dp"
android:layout_gravity="center_horizontal"
android:scaleType="centerInside"
android:src="@drawable/quran" />
<TextView
android:textAlignment="center"
android:text="@string/quran"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
<!-- Row 2 -->
<!-- Column 1 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startSonan"
android:layout_gravity="center_horizontal"
android:src="@drawable/sonan"
android:layout_width="wrap_content"
android:layout_height="90dp" />
<TextView
android:textAlignment="center"
android:text="@string/sonan"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
<!-- Column 2 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startSadaqa"
android:layout_width="wrap_content"
android:layout_height="90dp"
android:layout_gravity="center_horizontal"
android:scaleType="centerInside"
android:src="@drawable/sadaqah" />
<TextView
android:textAlignment="center"
android:text="@string/sadaqah"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
</GridLayout>
<LinearLayout
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_main_score"
android:onClick="showPoints"
android:text="@string/score"
android:textColor="@color/white"
android:textAlignment="center"
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
Any help on this would be greatly appreciated.
add a comment |
up vote
2
down vote
favorite
I am facing a problem and I have searched a lot about it but couldn't find a solution.
I used a grid layout in my design and it works fine with API level > 19, but when I run my App on API level 19 it doesn't work properly:
Here is a screenshot of my App running on API level > 19:
Screenshot (when API level > 19)
And on API level 19:
Screenshot (when API = 19)
I tried adding these lines to the gradle file but they didn't help:
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'
And here is my layout.xml code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/bg"
android:weightSum="10"
android:padding="10dp"
tools:context=".ui.home.HomeActivity">
<ImageView
android:layout_weight="1"
android:layout_gravity="center"
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="120dp"
app:srcCompat="@drawable/azkar_logo" />
<GridLayout
android:columnCount="2"
android:rowCount="2"
android:alignmentMode="alignMargins"
android:columnOrderPreserved="true"
android:padding="5dp"
android:layout_weight="8"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- Row 1 -->
<!-- Column 1 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startSalah"
android:layout_gravity="center_horizontal"
android:src="@drawable/praying"
android:layout_width="wrap_content"
android:layout_height="90dp" />
<TextView
android:textAlignment="center"
android:text="@string/salah"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
<!-- Column 2 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startQuran"
android:layout_width="wrap_content"
android:layout_height="90dp"
android:layout_gravity="center_horizontal"
android:scaleType="centerInside"
android:src="@drawable/quran" />
<TextView
android:textAlignment="center"
android:text="@string/quran"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
<!-- Row 2 -->
<!-- Column 1 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startSonan"
android:layout_gravity="center_horizontal"
android:src="@drawable/sonan"
android:layout_width="wrap_content"
android:layout_height="90dp" />
<TextView
android:textAlignment="center"
android:text="@string/sonan"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
<!-- Column 2 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startSadaqa"
android:layout_width="wrap_content"
android:layout_height="90dp"
android:layout_gravity="center_horizontal"
android:scaleType="centerInside"
android:src="@drawable/sadaqah" />
<TextView
android:textAlignment="center"
android:text="@string/sadaqah"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
</GridLayout>
<LinearLayout
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_main_score"
android:onClick="showPoints"
android:text="@string/score"
android:textColor="@color/white"
android:textAlignment="center"
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
Any help on this would be greatly appreciated.
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I am facing a problem and I have searched a lot about it but couldn't find a solution.
I used a grid layout in my design and it works fine with API level > 19, but when I run my App on API level 19 it doesn't work properly:
Here is a screenshot of my App running on API level > 19:
Screenshot (when API level > 19)
And on API level 19:
Screenshot (when API = 19)
I tried adding these lines to the gradle file but they didn't help:
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'
And here is my layout.xml code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/bg"
android:weightSum="10"
android:padding="10dp"
tools:context=".ui.home.HomeActivity">
<ImageView
android:layout_weight="1"
android:layout_gravity="center"
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="120dp"
app:srcCompat="@drawable/azkar_logo" />
<GridLayout
android:columnCount="2"
android:rowCount="2"
android:alignmentMode="alignMargins"
android:columnOrderPreserved="true"
android:padding="5dp"
android:layout_weight="8"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- Row 1 -->
<!-- Column 1 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startSalah"
android:layout_gravity="center_horizontal"
android:src="@drawable/praying"
android:layout_width="wrap_content"
android:layout_height="90dp" />
<TextView
android:textAlignment="center"
android:text="@string/salah"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
<!-- Column 2 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startQuran"
android:layout_width="wrap_content"
android:layout_height="90dp"
android:layout_gravity="center_horizontal"
android:scaleType="centerInside"
android:src="@drawable/quran" />
<TextView
android:textAlignment="center"
android:text="@string/quran"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
<!-- Row 2 -->
<!-- Column 1 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startSonan"
android:layout_gravity="center_horizontal"
android:src="@drawable/sonan"
android:layout_width="wrap_content"
android:layout_height="90dp" />
<TextView
android:textAlignment="center"
android:text="@string/sonan"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
<!-- Column 2 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startSadaqa"
android:layout_width="wrap_content"
android:layout_height="90dp"
android:layout_gravity="center_horizontal"
android:scaleType="centerInside"
android:src="@drawable/sadaqah" />
<TextView
android:textAlignment="center"
android:text="@string/sadaqah"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
</GridLayout>
<LinearLayout
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_main_score"
android:onClick="showPoints"
android:text="@string/score"
android:textColor="@color/white"
android:textAlignment="center"
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
Any help on this would be greatly appreciated.
I am facing a problem and I have searched a lot about it but couldn't find a solution.
I used a grid layout in my design and it works fine with API level > 19, but when I run my App on API level 19 it doesn't work properly:
Here is a screenshot of my App running on API level > 19:
Screenshot (when API level > 19)
And on API level 19:
Screenshot (when API = 19)
I tried adding these lines to the gradle file but they didn't help:
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'
And here is my layout.xml code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/bg"
android:weightSum="10"
android:padding="10dp"
tools:context=".ui.home.HomeActivity">
<ImageView
android:layout_weight="1"
android:layout_gravity="center"
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="120dp"
app:srcCompat="@drawable/azkar_logo" />
<GridLayout
android:columnCount="2"
android:rowCount="2"
android:alignmentMode="alignMargins"
android:columnOrderPreserved="true"
android:padding="5dp"
android:layout_weight="8"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- Row 1 -->
<!-- Column 1 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startSalah"
android:layout_gravity="center_horizontal"
android:src="@drawable/praying"
android:layout_width="wrap_content"
android:layout_height="90dp" />
<TextView
android:textAlignment="center"
android:text="@string/salah"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
<!-- Column 2 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startQuran"
android:layout_width="wrap_content"
android:layout_height="90dp"
android:layout_gravity="center_horizontal"
android:scaleType="centerInside"
android:src="@drawable/quran" />
<TextView
android:textAlignment="center"
android:text="@string/quran"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
<!-- Row 2 -->
<!-- Column 1 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startSonan"
android:layout_gravity="center_horizontal"
android:src="@drawable/sonan"
android:layout_width="wrap_content"
android:layout_height="90dp" />
<TextView
android:textAlignment="center"
android:text="@string/sonan"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
<!-- Column 2 -->
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:cardElevation="8dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="16dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:onClick="startSadaqa"
android:layout_width="wrap_content"
android:layout_height="90dp"
android:layout_gravity="center_horizontal"
android:scaleType="centerInside"
android:src="@drawable/sadaqah" />
<TextView
android:textAlignment="center"
android:text="@string/sadaqah"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
</GridLayout>
<LinearLayout
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_main_score"
android:onClick="showPoints"
android:text="@string/score"
android:textColor="@color/white"
android:textAlignment="center"
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
Any help on this would be greatly appreciated.
edited Nov 9 at 12:04
Nitin Gurbani
727215
727215
asked Nov 9 at 11:03
Nasr
134
134
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
GridView is really outdated.
You need to use RecyclerView with GridLayoutManager instead.
Here is a simple example as how to use it:
recyclerView.setLayoutManager(new GridLayoutManager(this, numberOfColumns));
i will try it now
– Nasr
Nov 9 at 11:09
thanks i was tring to make it manually but it didint work. your solution solve it Thanks
– Nasr
Nov 9 at 11:12
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
GridView is really outdated.
You need to use RecyclerView with GridLayoutManager instead.
Here is a simple example as how to use it:
recyclerView.setLayoutManager(new GridLayoutManager(this, numberOfColumns));
i will try it now
– Nasr
Nov 9 at 11:09
thanks i was tring to make it manually but it didint work. your solution solve it Thanks
– Nasr
Nov 9 at 11:12
add a comment |
up vote
1
down vote
accepted
GridView is really outdated.
You need to use RecyclerView with GridLayoutManager instead.
Here is a simple example as how to use it:
recyclerView.setLayoutManager(new GridLayoutManager(this, numberOfColumns));
i will try it now
– Nasr
Nov 9 at 11:09
thanks i was tring to make it manually but it didint work. your solution solve it Thanks
– Nasr
Nov 9 at 11:12
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
GridView is really outdated.
You need to use RecyclerView with GridLayoutManager instead.
Here is a simple example as how to use it:
recyclerView.setLayoutManager(new GridLayoutManager(this, numberOfColumns));
GridView is really outdated.
You need to use RecyclerView with GridLayoutManager instead.
Here is a simple example as how to use it:
recyclerView.setLayoutManager(new GridLayoutManager(this, numberOfColumns));
edited Nov 9 at 12:12
Nitin Gurbani
727215
727215
answered Nov 9 at 11:07
Onix
4228
4228
i will try it now
– Nasr
Nov 9 at 11:09
thanks i was tring to make it manually but it didint work. your solution solve it Thanks
– Nasr
Nov 9 at 11:12
add a comment |
i will try it now
– Nasr
Nov 9 at 11:09
thanks i was tring to make it manually but it didint work. your solution solve it Thanks
– Nasr
Nov 9 at 11:12
i will try it now
– Nasr
Nov 9 at 11:09
i will try it now
– Nasr
Nov 9 at 11:09
thanks i was tring to make it manually but it didint work. your solution solve it Thanks
– Nasr
Nov 9 at 11:12
thanks i was tring to make it manually but it didint work. your solution solve it Thanks
– Nasr
Nov 9 at 11:12
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53224500%2fgrid-layout-doesnt-work-properly-on-api-level-19%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown