我有RecyclerView
2 种布局。第一个描述主要项目,第二个是facebook
native Ad
。它可以工作,但每次显示在显示屏position
上NativeViewAd
时 - 我们都可以看到微滞后。
recycler_item.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="250dp"
android:orientation="vertical"
android:padding="8dp"
android:id="@+id/list_item">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/food_picture"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/blank2" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/test_name_food"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#242424"
android:paddingTop="4dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="8dp"
android:paddingBottom="8dp"
android:paddingRight="8dp"
android:paddingTop="4dp">
<TextView
android:id="@+id/ingr_count"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/test_name_ingr"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_weight="1"
android:textAlignment="center"
android:layout_gravity="center_vertical"
android:gravity="center" />
<!--
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="33">
<ImageView
android:id="@+id/ic_ingredient"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_ingredient"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:paddingRight="8dp" />
<ImageView
android:id="@+id/ic_time"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_time"
android:layout_gravity="center_vertical|right"
android:layout_weight="1"
android:paddingLeft="8dp" />
</LinearLayout>
-->
<TextView
android:id="@+id/look"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Просмотреть"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_gravity="center"
android:textAlignment="center"
android:gravity="center"
android:textColor="#4CAF50"
android:textStyle="bold"
android:typeface="normal"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
和additional.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="300dp"
android:orientation="vertical"
android:id="@+id/ad_test2"
android:background="@drawable/blank2">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/blank2"
android:id="@+id/blank_holder"/>
如果需要,这里是RecyclerAdapter.class
https://gist.github.com/burnix/d0b32f0dc4b525ec3aa7的要点,但我想, layouts
.
那么我该如何解决我的问题呢?
PSlayouts
即使有相同的height
,滞后也不会消失。