con*_*nks 2 java xml android android-studio
我在Android Studio中创建了一个滚动活动,我从设置FAB操作的活动中删除了代码,但活动xml中没有匹配的属性:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView 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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="myactivity"
tools:showIn="@layout/activity_edit_address">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/large_text" />
</android.support.v4.widget.NestedScrollView>
Run Code Online (Sandbox Code Playgroud)
我在Google上发现的所有内容都表示要删除FAB XML属性以阻止它显示,但这似乎已经过时,因为它不存在.我在哪里可以删除它?谢谢.
生成滚动活动时,它将生成2个名为activity_scrolling.xml和的xml文件content_scrolling.xml.只需从activity_scrolling.xml文件中删除FAB块即可.
删除此块:
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin"
app:layout_anchor="@id/app_bar"
app:layout_anchorGravity="bottom|end"
app:srcCompat="@android:drawable/ic_dialog_email" />
Run Code Online (Sandbox Code Playgroud)