-2
Greetings, My android application has a Linearlayout and, within it, a Gridview that is being filled correctly with the images I want.
The problem is that by scrolling the screen down (to see the rest of the icons), the last icons are out of order and the scrolling no longer works. Only by restarting the app Gridview starts working again.
Follow the code and screen with the problem:
<LinearLayout
android:id="@+id/layScroll"
android:layout_width="413dp"
android:layout_height="447dp"
android:background="@color/branco"
android:orientation="horizontal"
android:paddingLeft="0dp"
android:paddingTop="50dp"
android:paddingRight="0dp"
android:paddingBottom="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/frmPrincipal"
app:layout_constraintStart_toStartOf="@id/frmPrincipal"
app:layout_constraintTop_toBottomOf="@+id/imageView2">
<GridView
android:id="@+id/grvMain"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:columnWidth="60dp"
android:horizontalSpacing="10dp"
android:numColumns="2"
android:verticalSpacing="10dp"
app:layout_constraintTop_toTopOf="parent">
</GridView>
</LinearLayout>
The good screen (as soon as you open the app):
The bad screen (after you do the Scroll - I put several identical images to test the scroll):
After making the Scroll, the screen kind of hangs for at least 15 seconds and the icons are all messy inside the Gridview.
I tried to use Scrollview too and gave the same error/result.