我有一个活动,其中广告填充在从 java 代码填充的动态表上,该表具有从网络异步加载的图像。当我不包括广告时,一切都按我的预期工作。但是,当我包含 adview 以及从网络异步加载的图像时,它会挂起 UI,直到从网络加载图像。
我无法理解这种行为,您能否给我解决方案,图像应与 adview 一起异步加载。
以下是我的活动代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/linearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="********"
ads:loadAdOnCreate="true"
/>
<ScrollView
android:id="@+id/scroll1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout
android:id="@+id/table_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow>
<TextView
android:id="@+id/left_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="left|center_vertical"
android:padding="5dip"
android:text="Code" />
<TextView
android:id="@+id/middle_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right|center_vertical"
android:padding="5dip"
android:text="Name of Company" />
<TextView
android:id="@+id/right_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="right|center_vertical"
android:padding="5dip"
android:text="1.3" />
</TableRow>
</TableLayout>
</ScrollView>
</LinearLayout>
谢谢
阿曼迪普