Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/216.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Android Studio:FloatingActionButton不会消失(已编辑)_Java_Android - Fatal编程技术网

Java Android Studio:FloatingActionButton不会消失(已编辑)

Java Android Studio:FloatingActionButton不会消失(已编辑),java,android,Java,Android,我是android新手,所以请原谅我说的太明显了 <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary"

我是android新手,所以请原谅我说的太明显了

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

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


<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="top|end"
    android:layout_marginTop="@dimen/fab_margin_top"
    android:src="@drawable/ic_favorite_24dp"
    android:contentDescription="@string/save_description"

    android:layout_alignParentRight="true"

    android:layout_alignParentStart="false"
    android:layout_alignTop="@+id/tagTextInputLayout" />



<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/URLTextInputLayout"
    android:layout_below="@id/view"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true">
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:imeOptions="actionNext"
        android:hint="@string/url_prompt"
        android:singleLine="true"
        android:layout_below="@+id/view"
        android:layout_toRightOf="@+id/URLTextInputLayout"
        android:layout_toEndOf="@+id/URLTextInputLayout" />

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


<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/tagTextInputLayout"
    android:layout_below="@id/URLTextInputLayout">
<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="@string/tag_prompt"
    android:imeOptions="actionDone" />
</android.support.design.widget.TextInputLayout>

<LinearLayout
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/tagTextInputLayout">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="@string/tagged_links"
        android:id="@+id/textView"
        android:gravity="center_horizontal"
        android:textStyle="bold"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin" />

    <android.support.v7.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:id="@+id/recyclerView"
        android:layout_weight="1"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin" />
</LinearLayout>
我的第一个问题是浮动操作按钮。我基本上只需要打开FloatingActionButton来保存搜索,但还有一个按钮只在我运行应用程序时出现,而不在设计视图(或文本视图)中。。这是从哪里来的?我怎样才能删除它

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

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


<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="top|end"
    android:layout_marginTop="@dimen/fab_margin_top"
    android:src="@drawable/ic_favorite_24dp"
    android:contentDescription="@string/save_description"

    android:layout_alignParentRight="true"

    android:layout_alignParentStart="false"
    android:layout_alignTop="@+id/tagTextInputLayout" />



<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/URLTextInputLayout"
    android:layout_below="@id/view"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true">
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:imeOptions="actionNext"
        android:hint="@string/url_prompt"
        android:singleLine="true"
        android:layout_below="@+id/view"
        android:layout_toRightOf="@+id/URLTextInputLayout"
        android:layout_toEndOf="@+id/URLTextInputLayout" />

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


<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/tagTextInputLayout"
    android:layout_below="@id/URLTextInputLayout">
<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="@string/tag_prompt"
    android:imeOptions="actionDone" />
</android.support.design.widget.TextInputLayout>

<LinearLayout
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/tagTextInputLayout">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="@string/tagged_links"
        android:id="@+id/textView"
        android:gravity="center_horizontal"
        android:textStyle="bold"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin" />

    <android.support.v7.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:id="@+id/recyclerView"
        android:layout_weight="1"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin" />
</LinearLayout>
XML文件

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

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


<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="top|end"
    android:layout_marginTop="@dimen/fab_margin_top"
    android:src="@drawable/ic_favorite_24dp"
    android:contentDescription="@string/save_description"

    android:layout_alignParentRight="true"

    android:layout_alignParentStart="false"
    android:layout_alignTop="@+id/tagTextInputLayout" />



<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/URLTextInputLayout"
    android:layout_below="@id/view"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true">
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:imeOptions="actionNext"
        android:hint="@string/url_prompt"
        android:singleLine="true"
        android:layout_below="@+id/view"
        android:layout_toRightOf="@+id/URLTextInputLayout"
        android:layout_toEndOf="@+id/URLTextInputLayout" />

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


<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/tagTextInputLayout"
    android:layout_below="@id/URLTextInputLayout">
<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="@string/tag_prompt"
    android:imeOptions="actionDone" />
</android.support.design.widget.TextInputLayout>

<LinearLayout
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/tagTextInputLayout">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="@string/tagged_links"
        android:id="@+id/textView"
        android:gravity="center_horizontal"
        android:textStyle="bold"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin" />

    <android.support.v7.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:id="@+id/recyclerView"
        android:layout_weight="1"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin" />
</LinearLayout>


请将此问题分为两个问题。我刚刚将问题分为两个部分,尝试从空活动开始,而不是从空活动开始。我希望有其他解决方法,但我想我必须重新开始-_-
    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

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


<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="top|end"
    android:layout_marginTop="@dimen/fab_margin_top"
    android:src="@drawable/ic_favorite_24dp"
    android:contentDescription="@string/save_description"

    android:layout_alignParentRight="true"

    android:layout_alignParentStart="false"
    android:layout_alignTop="@+id/tagTextInputLayout" />



<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/URLTextInputLayout"
    android:layout_below="@id/view"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true">
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:imeOptions="actionNext"
        android:hint="@string/url_prompt"
        android:singleLine="true"
        android:layout_below="@+id/view"
        android:layout_toRightOf="@+id/URLTextInputLayout"
        android:layout_toEndOf="@+id/URLTextInputLayout" />

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


<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/tagTextInputLayout"
    android:layout_below="@id/URLTextInputLayout">
<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="@string/tag_prompt"
    android:imeOptions="actionDone" />
</android.support.design.widget.TextInputLayout>

<LinearLayout
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/tagTextInputLayout">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="@string/tagged_links"
        android:id="@+id/textView"
        android:gravity="center_horizontal"
        android:textStyle="bold"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin" />

    <android.support.v7.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:id="@+id/recyclerView"
        android:layout_weight="1"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin" />
</LinearLayout>