Android:定义layout_behaviour路径

时间:2018-08-13 13:52:19

标签: android path android-coordinatorlayout

我目前正在为协调器布局中的按钮处理自定义行为,我想使用“ app:layout_behavior”字段通过xml对其进行设置。不幸的是,我在设置路径时遇到了问题。我课程的路径如下:com.example.robert.testapp.ButtonSnackbarBehaviour 但是当我这样设置时: app:layout_behavior="com.example.robert.testapp.ButtonSnackbarBehaviour"  它不起作用(抛出 08-13 12:25:21.815 5527-5548/com.example.robert.testapp E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da glUtilsParamSize: unknow param 0x000082da)。可能只是一些菜鸟错误,不过我看不出有什么问题。 预先感谢您的帮助

编辑:这是我的XML文件

<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/EntryScreenCoordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/colorWhite">
<Button
    android:id="@+id/EntryScreenAccelerometerButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Accelerometer screen"
    android:layout_gravity="bottom|end"
    app:layout_behaviour="com.example.robert.testapp.ButtonSnackbarBehaviour"
    />
<Button
    android:id="@+id/EntryScreenButtonToImages"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Make Fragment"
    android:layout_gravity="bottom|start"
    app:layout_behavior="com.example.robert.testapp.ButtonSnackbarBehaviour"
    />
<android.support.design.widget.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"/>
<android.support.constraint.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">



<Button
    android:id="@+id/EntryScreenButtonToJSONLoader"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintLeft_toRightOf="@id/EntryScreenButtonToNoXmlFragment"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    android:text="Load JSON"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
<Button
    android:id="@+id/EntryScreenButtonToNoXmlFragment"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/entry_screen_to_no_xml_button"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toLeftOf="@id/EntryScreenButtonToJSONLoader"/>
<Button
    android:id="@+id/EntryScreenButtonInternetCheck"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/entry_screen_internet_check_button"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    />
</android.support.constraint.ConstraintLayout>

1 个答案:

答案 0 :(得分:0)

显然,第一种颜色有错别字(“ color”代表“ color”)。问题解决了,谢谢大家的参与

相关问题