首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在android的nestedscrollview中设置横幅广告

如何在android的nestedscrollview中设置横幅广告
EN

Stack Overflow用户
提问于 2018-05-30 15:29:16
回答 1查看 127关注 0票数 1
代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView 
xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" 
xmlns:ads="http://schemas.android.com/apk/res-auto"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:showIn="@layout/activity_scrolling1">

 <com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        ads:adSize="BANNER"
        ads:adUnitId="@string/banner_ad_unit_id" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/text_margin"
        android:text="@string/large_text" />
</android.support.v4.widget.NestedScrollView>

如何在android的nestedscrollview中设置横幅广告?

EN

回答 1

Stack Overflow用户

发布于 2018-05-31 17:38:56

一个NestedScrollView只能有一个子,而你的只能有两个。只需使用LinearLayout作为滚动视图的单个子级,并在其中添加you childs。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50598792

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档