这个问题的标题基本上说明了一切。我得到错误: 从 CollapsingToolbarLayout 中找不到 app:layout_scrollflags 的资源标识符。我使用eclipse并导入了设计库jar文件。我可以在我的类(class)中使用设计支持布局,这是正确的
这是我使用的一段代码:
<LinearLayout
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:orientation="vertical"
android:background="@color/activityBg"
tools:context=".MainActivity"
>
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<include
layout="@layout/toolbar"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
示例:http://android-developers.blogspot.in/2015/05/android-design-support-library.html
最佳答案
只导入设计库jar文件是不够的。您需要导入 android-design-library 项目的资源,而 jar 文件只包含类文件。
照我说的做:
您必须这样做,因为 xmlns:app="http://schemas.android.com/apk/res-auto" 意味着您需要来自库项目或当前的本地资源项目,在这种情况下,这意味着您需要来自 android-design-library 的库项目的资源。
关于android - 找不到应用程序 :layout_scrollflags from CollapsingToolbarLayout 的资源 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31179435/