Note that there are some explanatory texts on larger screens.

plurals
  1. POadmob sticking to the top of linearlayout in android
    primarykey
    data
    text
    <p>I have got this linear layout in my xml</p> <pre><code>&lt;LinearLayout android:layout_gravity="bottom" android:layout_width="fill_parent" android:background="#FFF0F000" android:id="@+id/questionAdLayout" android:layout_height="fill_parent" android:minHeight="10dip"&gt;&lt;/LinearLayout&gt; </code></pre> <p>and this is the code putting adview in it</p> <pre><code>adView = new AdView(this, AdSize.BANNER, MY_AD_UNIT_ID ); AdRequest adRequest = new AdRequest(); adRequest.addTestDevice(AdRequest.TEST_EMULATOR); adView.loadAd(adRequest); adView.setGravity(Gravity.BOTTOM); ((LinearLayout) findViewById(R.id.questionAdLayout)).addView(adView); </code></pre> <p>however the ad sticks to the top, instead of bottom, what am I doing wrong?</p> <p>this is the full layout</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:id="@+id/questionLayout" android:layout_height="fill_parent" android:background="@drawable/stupid_bg_small"&gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="The Stupid Test" android:textStyle="bold" android:textSize="20sp" android:textColor="#000000" android:padding="5dp" android:gravity="center_vertical|center_horizontal" android:layout_gravity="center_vertical|center_horizontal|center" /&gt; &lt;LinearLayout android:layout_height="wrap_content" android:id="@+id/ProgressRow" android:layout_width="fill_parent" android:orientation="horizontal"&gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Progress" android:textSize="15sp" android:textColor="#111111" android:layout_weight="3" android:gravity="center_vertical|right" android:paddingRight="10dp" /&gt; &lt;ProgressBar android:id="@+id/ProgressMeter" style="@android:style/Widget.ProgressBar.Horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:max="16" android:progress="-1" android:layout_weight="1" android:paddingRight="10dp" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="horizontal"&gt; &lt;TextView android:layout_width="wrap_content" android:gravity="top|center" android:layout_height="wrap_content" android:textSize="15sp" android:text="1" android:textStyle="bold" android:textColor="#000000" android:id="@+id/QuestionNumber" android:padding="10dp" /&gt; &lt;TextView android:layout_width="fill_parent" android:id="@+id/QuestionText" android:layout_height="wrap_content" android:textSize="16sp" android:text="A truck driver goes down a one-way street the wrong way past several police officers. How does he avoid getting caught?" android:textStyle="bold" android:textColor="#000000" android:padding="10dp" /&gt; &lt;/LinearLayout&gt; &lt;ListView android:id="@+id/AnswerListView" android:background="@layout/roundcorder" android:layout_margin="10dp" android:minHeight="40px" android:choiceMode="singleChoice" android:cacheColorHint="@android:color/transparent" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;LinearLayout android:layout_gravity="bottom" android:layout_width="fill_parent" android:background="#FFF0F000" android:id="@+id/questionAdLayout" android:layout_height="fill_parent" android:minHeight="10dip"&gt;&lt;/LinearLayout&gt; &lt;LinearLayout android:layout_height="fill_parent" android:background="#FF00FF00" android:layout_gravity="bottom" android:minHeight="10dip" android:layout_width="fill_parent" /&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload