我已从此处物料抽屉https://github.com/kanytu/android-material-drawer-template
实施了导航抽屉我的问题是我想在导航抽屉列表的末尾添加注销。
这是我的抽屉xml:
<mynews.volume.com.mynews.materialnavigation.ScrimInsetsFrameLayout
android:id="@+id/scrimInsetsFrameLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:insetForeground="#99000000"
android:elevation="10dp"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
</mynews.volume.com.mynews.materialnavigation.ScrimInsetsFrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/toolbar_actionbar"
layout="@layout/toolbar_default"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<FrameLayout
android:id="@+id/container"
android:layout_width="fill_parent"
android:clickable="true"
android:layout_height="match_parent">
<mynews.volume.com.mynews.swipe.SwipeListView
android:id="@+id/news_list_view"
android:listSelector="#00000000"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
swipe:swipeFrontView="@+id/front"
swipe:swipeBackView="@+id/back"
swipe:swipeDrawableChecked="@drawable/choice_selected"
swipe:swipeDrawableUnchecked="@drawable/choice_unselected"
swipe:swipeCloseAllItemsWhenMoveList="true"
swipe:swipeActionRight="reveal"
swipe:swipeMode="right"
/>
<!--<ListView-->
<!--android:layout_width="fill_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:id="@+id/news_list_view"-->
<!--android:divider="#E5E6E8"-->
<!--android:listSelector="@android:color/transparent"-->
<!--android:dividerHeight="3dp"-->
<!--/>-->
<ProgressBar
android:id="@+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<TextView
android:layout_width="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:textSize="25dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_marginTop="200dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text=""
android:visibility="gone"
android:id="@+id/noData" />
</FrameLayout>
</LinearLayout>
<!-- android:layout_marginTop="?android:attr/actionBarSize"-->
<fragment
android:id="@+id/fragment_drawer"
android:name="mynews.volume.com.mynews.materialnavigation.NavigationDrawerFragment"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout="@layout/fragment_navigation_drawer"/>
请指导我实现这一目标。
答案 0 :(得分:0)
这是按钮的代码尝试实现它
<Button
android:id="@+id/button1"
android:stateListAnimator="@anim/my_animator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" //You need this
android:layout_centerHorizontal="true"//and this
android:layout_below="@id/mapview"
android:text="@string/save" />
希望有所帮助