Sunday, 1 September 2013

adcontrol hiding text in the android app

adcontrol hiding text in the android app

I am creating a small android app When I am adding a adcontrol at the
bottom of the screen, it hides a small part of the content that is shown
in the scroll view
Here is the xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top"
tools:context=".MainActivity"
android:id="@+id/mainActivityParentRelativeLayout">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:id="@+id/scrollView">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:id="@+id/idTableLayout"
android:stretchColumns="*"
android:shrinkColumns="*">
</TableLayout>
</ScrollView>
</RelativeLayout>
In the table layout I am adding multiple textviews dynamically
Also I am adding adcontrol dynamically Here is the code for that
{
RelativeLayout linearLayout =
(RelativeLayout)findViewById(R.id.mainActivityParentRelativeLayout);
AdView adview = Utilities.AddAdMobControl(this);
RelativeLayout.LayoutParams params= new
RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, adview.getId());
adview.setLayoutParams(params);
linearLayout.addView(adview);
}

No comments:

Post a Comment