1
這是我的佈局文件。按鈕不顯示在活動的底部 - android
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:id="@+id/coordinatorLayout"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
android:layout_alignParentTop="true"/>
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/toolbar"
android:background="@color/primary"
android:elevation="6dp"
android:minHeight="?attr/actionBarSize"
app:tabIndicatorColor="@android:color/white"
app:tabIndicatorHeight="4dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tab_layout"
android:layout_above="@+id/floating_button"
android:background="@color/windowBackground"
android:paddingLeft="30dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<Button android:id="@+id/floating_button"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"
android:text="Go to Shopping Cart"
android:theme="@style/MyButton"/>
</android.support.design.widget.CoordinatorLayout>
<fragment
android:id="@+id/fragment_navigation_drawer"
android:name="com.wokoshop.sony.fragment.FragmentDrawer"
android:layout_width="@dimen/nav_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout="@layout/fragment_navigation_drawer"
tools:layout="@layout/fragment_navigation_drawer" />
</android.support.v4.widget.DrawerLayout>
我想顯示活動的按鈕底部。但它根本不顯示。
有人可以幫助我我失蹤了嗎?
看到這一點。 https://guides.codepath.com/android/floating-action-buttons –