android - AdView layout takes up whole screen -
i have following xml layout:
<relativelayout android:layout_width="fill_parent" android:layout_height="fill_parent"> <scrollview android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillviewport="true" android:layout_above="@+id/adcontent1" android:background="#0000ff"> <textview android:id="@+id/tempview" android:layout_width="fill_parent" android:layout_height="wrap_content"/> </scrollview> <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#ff0000" android:layout_alignparentbottom="true" android:id="@+id/adcontent1" > <com.google.ads.adview xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:id="@+id/adview1" android:layout_width="wrap_content" android:layout_height="wrap_content" app:adsize="banner" app:adunitid="lah-di-da" android:layout_alignparentbottom="true" android:layout_centerhorizontal="true"> </com.google.ads.adview> </relativelayout> </relativelayout>
the problem is, reason, wrap_content
adview
relativelayout
height attribute causes whole relativelayout
take whole screen. if set hard value (50px
) scrollview
taking whole screen - 50px (like want, except relativelayout
height should equal adview
height. know why adview
forces parent relativelayout
fill screen?
note: there layouts behind these, have no influence on specific issue (as tested setting height = 50px).
try set height of ad '50dp' , post results
Comments
Post a Comment