1. 程式人生 > >上滑 顯示底部 下滑 隱藏頂部 協調者佈局

上滑 顯示底部 下滑 隱藏頂部 協調者佈局

<?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:fitsSystemWindows="true"
    android:background="@color/main_activity_color"
    tools:openDrawer="start">

    <android.support.design.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        >

        <android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/AppLockAppBarOverlay">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="@drawable/actionbar_background"
                app:layout_scrollFlags="scroll|enterAlways"
                app:popupTheme="@style/AppLockPopupOverlay"/>

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

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">

            <android.support.v7.widget.RecyclerView
                android:id="@+id/app_list"
                android:layout_above="@+id/adView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scrollbars="vertical">

            </android.support.v7.widget.RecyclerView>
            <FrameLayout
                android:id="@+id/adView"
                android:layout_alignParentBottom="true"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"></FrameLayout>
        </RelativeLayout>


    </android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.DrawerLayout>



主要是

  app:layout_behavior="@string/appbar_scrolling_view_behavior"
    <string name="appbar_scrolling_view_behavior" translatable="false">android.support.design.widget.AppBarLayout$ScrollingViewBehavior</string>
下面的應該是沒有用到
   <style name="AppLockAppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
    <style name="AppLockPopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
app樣式是

繼承這個 

Theme.AppCompat.Light.DarkActionBar
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>




相關推薦

顯示底部 下滑 隱藏頂部 協調佈局

<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk

Android筆記(一):ViewDragHelper實現底部同時底部下滑

先看看效果圖: 自定義佈局控制元件: public class DragLayout extends FrameLayout { private int title; //限制上滑後的頂部標題高度大小 private Status mStatus

android 7.0平臺客製化虛擬導航按鍵(隱藏NavigationBar,顯示NavigationBar)

如圖,需求是增加一個按鈕可以隱藏NavigationBar,上滑顯示NavigationBar。  參考文章: 1.首先新建一個hide_show.xml,其中systemui:keyCode="142"為事件值,相當與F12. <?xml versi

Android 協調佈局

協調者佈局的誕生:             Android在推出5.0版本後推出了材料設定概念,並推出了design相容包,而我們本章所需要說的協調者佈局(CoordinatorLa

Android 開發 CoordinatorLayout 協調佈局 與 ConstraintLayout約束佈局 兩者的關係

  在摸索新技術是發現CoordinatorLayout 與 ConstraintLayout 會有衝突關係,所以就研究了一下他們之間的不相容,被影響的方面.其實某種程度上來說是CoordinatorLayout與其他Layout佈局之間的關係.     首先說明一下:   Coor

CoorinatorLayout協調佈局

CoorinatorLayout是官方號稱的一種功能十分強大的FrameLayout(注意最新的實現是ViewGroup),主要有以下的兩種基本應用場景: 1. 作為應用的頂層裝飾佈局;

安卓5.0推出的協調佈局,其實關鍵的程式碼都在xml佈局

今天想做一個滑動到螢幕頂端的就停在哪裡大圖title,搜了一下資料,其實so  easy,直接上程式碼 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http:

Android 協調佈局

協調者佈局的誕生:             Android在推出5.0版本後推出了材料設定概念,並推出了design相容包,而我們本章所需要說的協調者佈局(CoordinatorLayout)就在這design相容包之中。所以說,我們想要使用協調者佈局就需要去匯入desig

協調佈局 實現上下滑動

activity_main <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://sc

CoordinatorLayout,協調佈局

CoordinatorLayout,中文譯作協調者佈局,光聽這名字你可能很難判斷出協調者佈局有什麼特點,那麼我們來看看下面一張圖片: 由於CSDN對圖片大小的要求,我只能錄製一個快速播放的動畫,請大家見諒。但是顯示效果大家應該都看到了,就是當在頁面的上方有一個圖片,

Android 浮動按鈕+隱藏按鈕+下滑顯示按鈕

nbut etc win cti turn else http alpha targe 1.效果演示 1.1.關註這個紅色的浮動按鈕   、   可以看到,上滑的時候浮動按鈕消失,因為用戶迫切想知道下面的東西,而不是回到頂部。   當下滑的時候,用戶想回

uwp - 隱藏導航欄下滑顯示

原文: uwp - 上滑隱藏導航欄下滑顯示   好久沒寫部落格了,因為忙著工作。昨天週末填坑需要做一個上滑列表資料時隱藏導航欄下滑時顯示的效果,下面分享一下我的做法,希望能給你帶來幫助。   思路是通過判斷滾動條是往下還是往上滑然後做出相應的顯示隱藏導航欄處理即可;

仿知乎主頁,隱藏NavigationBar,下滑顯示

最近在仿作知乎客戶端,知乎首頁的 navigationBar 會隨著下方的 tableView 滑動而改變,上滑隱藏,下拉顯示,並且下拉需要一定速度才會觸發顯示。在網上查了一下,看到一個隨 TableView 滑動改變 NavigationBar 透明度的demo,雖然和自

Android bc信用盤搭建自定義behavior 實現 隱藏底部view

退出 Y軸 log rect app sum string dsl oss 布局 <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent"

Android關於CoordinatorLayout和ListView滑動衝突的解決(ToolBar隱藏下滑出現)

最近專案中使用到了CoordinatorLayout這種佈局方式,搭配RecycleView,實現起來比較簡單,而且不用自己處理滑動事件,但是改為了ListView後發生了滑動衝突. 所以想到了以下解決方案: 1.使用事件分發,當ListView在Y軸滑動時,將事件交給C

net3:文件傳與圖片顯示以及HiddenField隱藏字段值的使用

pos protect path 來源 file ipa gif sender uri 原文發布時間為:2008-07-29 —— 來源於本人的百度文章 [由搬家工具導入]using System;using System.Data;using System.Configu

禁止 下滑的時候出現微信瀏覽器的黑色背景

scrolltop tails hidden otto listener sin listen scrip 滾動事件 轉載:http://blog.csdn.net/yingzhi3104/article/details/78730342 網頁加載完調用 $(functio

微信 判斷 下滑 操作

技術 Y軸 頻繁 dto html nbsp log 下滑 event 1:判斷用戶動作,“向上滑動” 或者 “向下滑動”,閑話不多說,直接上代碼:   方法1 ( 利用 bindtouchmove,缺點:可能會頻繁操作 setData 方法 ) : <view

ionic3在ios頂部導航欄顯示不正常--據頂部有空隙條

在專案中遇到這樣的問題: 如圖: 頂部導航平白多了一道白條,而且這個只是在ios的真機或者是模擬器上才顯示,用chrome和android真機是一點問題沒有,於是就重新下載了一個tabs專案,執行,也沒有問題,一點點兒找原因才發現是因為覺得不需要頂部導航,就給去掉了,於是,解決的

前端特效:導航 、個人中心出(左、右下滑)效果實現

效果圖: 直接列出實現程式碼: 1.html <div class="left_slide_center_nav"> <!--蒙層--> <d