zoukankan      html  css  js  c++  java
  • Android Training精要(二)開啟ActionBar的Overlay模式

    在3.0上的實現

    <resources> 
        <!-- the theme applied to the application or activity --> 
        <style name="CustomActionBarTheme" 
               parent="@android:style/Theme.Holo"> 
            <item name="android:windowActionBarOverlay">true</item> 
        </style> 
    </resources>
    


    還需要在遮蓋的Layout上加上android:paddingTop的值

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:paddingTop="?android:attr/actionBarSize"> 
        ... 
    </RelativeLayout>
    

    2.1上的實現:

    <resources> 
        <!-- the theme applied to the application or activity --> 
        <style name="CustomActionBarTheme" 
               parent="@android:style/Theme.AppCompat"> 
            <item name="android:windowActionBarOverlay">true</item> 
            <!-- Support library compatibility --> 
            <item name="windowActionBarOverlay">true</item> 
        </style> 
    </resources>
    

    在遮蓋的Layout上加上android:paddingTop的值

    <!-- Support library compatibility --> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:paddingTop="?attr/actionBarSize"> 
        ... 
    </RelativeLayout>
    



  • 相关阅读:
    test
    在linux下安装tesseract-ocr
    xpath获取同级节点
    RobotFrameWork系统关键字之断言
    redis
    mybatis
    mysql事务隔离级别
    努力努力再努力
    不同分辨率下,页面如何自适应?
    市场上有多少种分辨率?
  • 原文地址:https://www.cnblogs.com/krislight1105/p/3748339.html
Copyright © 2011-2022 走看看