我有一个RecyclerView,其每一行都有一个GridLayout。我在RecyclerView中插入了一些行(大约10行)。它在Nexus 5和Nexus 7以及Sony中流畅地滚动。但是当我在三星Note 4上运行它时,它滚动非常慢并且有很多滞后! 这是我每行的布局:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.GridLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
app:orientation="vertical"
app:columnCount="4"
>
<TextView
android:id="@+id/start_time_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_gravity="left|center_vertical"
app:layout_row="0"
app:layout_column="0"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:text="test"
/>
<View
android:layout_width="1dp"
android:layout_height="0dp"
app:layout_row="0"
app:layout_column="1"
app:layout_rowSpan="3"
app:layout_gravity="fill"
android:background="@color/dim_foreground_disabled_material_dark"
/>
<TextView
android:id="@+id/textView"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_row="0"
app:layout_column="2"
android:singleLine="true"
app:layout_gravity="right|center_vertical|fill"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:ellipsize="end"
android:layout_margin="10dp"
android:text="test"
/>
<ImageView
android:id="@+id/event_icon"
android:layout_width="32dp"
android:layout_height="32dp"
app:layout_row="0"
app:layout_column="3"
app:layout_gravity="center_vertical"
android:src="@mipmap/ic_launcher"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_row="1"
app:layout_column="1"
app:layout_columnSpan="2"
app:layout_gravity="center_horizontal|center_vertical"
>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_gravity="center_horizontal|center_vertical|fill"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@color/button_material_dark"
android:layout_margin="6dp"
android:text="test"
/>
<ImageView
android:id="@+id/imageView1"
android:layout_width="25dp"
android:layout_height="25dp"
app:layout_gravity="center_horizontal|center_vertical"
android:src="@mipmap/ic_supervisor_account_black_24dp"/>
</LinearLayout>
<TextView
android:id="@+id/end_time_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_row="2"
app:layout_column="0"
app:layout_gravity="left|center_vertical"
android:paddingRight="10dp"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:text="test"
/>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_row="2"
app:layout_column="2"
app:layout_gravity="right|center_vertical"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textColor="@color/button_material_dark"
android:layout_margin="10dp"
android:text="test"
/>
<ImageView
android:id="@+id/imageView2"
android:layout_width="15dp"
android:layout_height="15dp"
app:layout_gravity="center_vertical"
app:layout_row="2"
app:layout_column="3"
android:src="@mipmap/location"/>
<ProgressBar
android:id="@+id/time_progressbar"
app:layout_row="3"
app:layout_column="0"
app:layout_columnSpan="3"
app:layout_gravity="fill"
android:max="100"
android:progress="100"
style="?android:attr/progressBarStyleHorizontal"
android:indeterminate="false" />
<TextView
android:id="@+id/time_text_view"
app:layout_row="3"
app:layout_column="3"
app:layout_gravity="right|center_vertical|fill"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:text="test"
/>
</android.support.v7.widget.GridLayout>
如何解决此问题?