AdMob AdView and ViewPager?

后端 未结 2 825
误落风尘
误落风尘 2020-12-30 11:18

I have Android application with ViewPager implemented like this :

http://www.youtube.com/watch?v=C6_1KznO95A

I don\'t know how to implement AdView below the

2条回答
  •  再見小時候
    2020-12-30 11:48

    OK, you have a couple of problems.

    1. orientation is only relevant for a LinearLayout.
    2. layout_alignParentBottom needs a boolean value not "top"
    3. layout_weight is only relevant for a LinearLayout nor RelativeLayout

    You have 2 options. Use a RelativeLayout but define the AdView first with the ViewPager being defined as above it OR use a LinearLayout and have the ViewPager fill the unused space using layout_weight.

    As RelativeLayout

    
    
    
    
    
    
    
    

    OR as LinearLayout

    
    
    
    
    
    
    
    

    Personally I'd go with the LinearLayout it feels simpler.

提交回复
热议问题