Android 使用工具栏滑动时,底部对齐几乎从屏幕底部对齐
我最近将我的listview迁移到了recyclerview,这样我就可以在工具栏上产生效果,只显示选项卡/recyclerview 现在的情况是,当我尝试将一个元素与底部对齐时,该元素正在从底部脱离屏幕 我必须添加大约60 DP的保证金底部来修复它。 但在我的浮动动作按钮中,这些60 DP会影响动画,所以我不太喜欢它 有人知道这个把戏吗 这是我的密码: 第一选项卡Android 使用工具栏滑动时,底部对齐几乎从屏幕底部对齐,android,androiddesignsupport,Android,Androiddesignsupport,我最近将我的listview迁移到了recyclerview,这样我就可以在工具栏上产生效果,只显示选项卡/recyclerview 现在的情况是,当我尝试将一个元素与底部对齐时,该元素正在从底部脱离屏幕 我必须添加大约60 DP的保证金底部来修复它。 但在我的浮动动作按钮中,这些60 DP会影响动画,所以我不太喜欢它 有人知道这个把戏吗 这是我的密码: 第一选项卡 <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmln
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#CCC">
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/lista_tiendas"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:divider="@android:color/transparent"
android:dividerHeight="1.0sp" />
<com.melnykov.fab.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginTop="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="76dp"
android:src="@drawable/ic_add_white_24dp"
app:fab_type="normal"
app:fab_shadow="true"
app:fab_colorNormal="@color/spg_rosa"
app:fab_colorPressed="@color/spg_rosa_dark"
/>
<!--<android.support.design.widget.FloatingActionButton-->
<!--android:id="@+id/fab"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_gravity="right|bottom"-->
<!--android:src="@drawable/ic_add_white_48dp"-->
<!--app:backgroundTint="@color/spg_rosa"-->
<!--android:transitionName="@string/transition_add_pdv"-->
<!--app:borderWidth="0dp"-->
<!--app:elevation="8dp"-->
<!--app:fabSize="normal" />-->
</FrameLayout>
第二选项卡
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="50">
<com.google.android.gms.maps.MapView
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:id="@+id/maps_unavailable"
style="@style/placeholder_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/maps_unavailable"
android:visibility="gone" />
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="@dimen/map_pager_height"
android:layout_gravity="bottom"
android:layout_marginBottom="55dp"/>
</FrameLayout>
以及协调人的布局
<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/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
有什么想法吗?看起来是同样的问题: