0

My question is the same like this: Make adview stick in place when sliding menu

Can anyone tell me please how can I solve this ? Thank you very much.

update:

    menu = new SlidingMenu(this);
    menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
    menu.setShadowWidthRes(R.dimen.sliding_menu_shadow_width);
    menu.setShadowDrawable(R.drawable.sliding_menu_shadow);
    menu.setBehindOffsetRes(R.dimen.sliding_menu_offset);
    menu.setFadeDegree(0.35f);
    menu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW);
    menu.setMenu(R.layout.main_menu);

this is my slidingMenu

and this is my xml :

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#444444"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:orientation="vertical">

<FrameLayout
    android:id="@+id/mainContent"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_above="@+id/adView"
    android:layout_alignParentTop="true" >

</FrameLayout>

 <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_alignParentLeft="true"
     ads:adSize="BANNER"
     ads:adUnitId="@string/banner_ad_unit_id" >

 </com.google.android.gms.ads.AdView>

  </RelativeLayout>

So I have 2 different xml file one for menu and one for the "main page" .

Community
  • 1
  • 1
user2629828
  • 685
  • 1
  • 8
  • 13

1 Answers1

0

Take FrameLayout and add jfeinstein sliding menu and adView in it. The structure will be.

<FrameLayout ....

>

<jfeinsteinSlider ... />

<AdView .../>  This shoul be wrap_content for height and set apropirate gravity to the view

</FrameLayout>

Hope this will solve your problem

Suhail Mehta
  • 5,514
  • 2
  • 23
  • 37