文字位于Android滚动活动中的应用栏上

时间:2018-09-13 13:11:18

标签: android android-collapsingtoolbarlayout

我创建了一个新的Empty活动并添加了以下代码。但问题是文本仍在应用栏上。如何解决此问题...或任何解决方案...我搜索了StackOverFlow。但是我找不到任何答案,请给我相关的解决方案。 请看下面的gif图片。     enter image description here

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout     
  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"
  android:fitsSystemWindows="true"
  tools:context="com.lars.problem.problem.ScrollingActivity">

<android.support.design.widget.AppBarLayout
  android:id="@+id/app_bar"
  android:layout_width="match_parent"
  android:layout_height="@dimen/app_bar_height"
  android:fitsSystemWindows="true"
  android:theme="@style/AppTheme.AppBarOverlay">

<android.support.design.widget.CollapsingToolbarLayout
    android:id="@+id/toolbar_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    app:contentScrim="?attr/colorPrimary"
    app:layout_scrollFlags="scroll|exitUntilCollapsed">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        app:layout_collapseMode="pin"
        app:popupTheme="@style/AppTheme.PopupOverlay" />
        </android.support.design.widget.CollapsingToolbarLayout>
  </android.support.design.widget.AppBarLayout>

<RelativeLayout
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_below="@+id/toolbar_layout">

<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@+id/adView"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.lars.problem.problem.ScrollingActivity"
    tools:showIn="@layout/activity_scrolling">

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/text_margin"
        android:text="@string/large_text" />
    </LinearLayout>

</android.support.v4.widget.NestedScrollView>

<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_alignParentStart="true"
    app:adSize="SMART_BANNER"
    app:adUnitId="ca-app-pub-3940256099942544/6300978111"/>

 </RelativeLayout>

</android.support.design.widget.CoordinatorLayout>

谢谢..

0 个答案:

没有答案