我有一个包含RecycleView的活动,最多包含30个项目.每个项目包含2到3个文本视图和1个按钮.单击按钮我有动画.
在添加admob横幅之前,性能非常好,滚动顺畅.
添加admob横幅后,滚动正在剪切,单击按钮需要稍作响应.另外,我看到消息显示我在主线程上工作太多了!
关于如何修复它有什么建议吗?或者有什么可以帮助它变得更好?如何在启用admob横幅的情况下顺利滚动?
希望我不是唯一面临这个问题的人!
更新:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:paddingTop="30dp"
android:paddingBottom="64dp"
android:clipToPadding="false"
android:id="@+id/rv_Test"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_gravity="center|bottom"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
这似乎adView是问题所在,我已将其替换adView为NativeContentAdView使用原生广告
现在滚动很流畅
这是文档的链接 https://developers.google.com/admob/android/native
| 归档时间: |
|
| 查看次数: |
1864 次 |
| 最近记录: |