Using AppCompat 'layout_behavior' with '@string/appbar_scrolling_view_behavior' throws exception

来源:互联网 发布:python 将字符串split 编辑:程序博客网 时间:2024/05/16 17:47
layout_behavior属性报错
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    xmlns:app="http://schemas.android.com/apk/res-auto"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:paddingLeft="@dimen/activity_horizontal_margin"    android:paddingRight="@dimen/activity_horizontal_margin"    android:paddingTop="@dimen/activity_vertical_margin"    android:paddingBottom="@dimen/activity_vertical_margin"    app:layout_behavior="@string/appbar_scrolling_view_behavior"    tools:showIn="@layout/activity_index"    tools:context="com.news.ui.activty.IndexActivity"></RelativeLayout>
解决方案
   strings.xml  添加如下: 
<string name="appbar_scrolling_view_behavior">android.support.design.widget.AppBarLayout$ScrollingViewBehavior</string>
0 0