• 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>
    



  • 相关阅读:
    第一周软件测试
    第八周
    第七
    安卓第六周作业
    安卓第五周
    第四周作业
    Jsp第十次作业
    Jsp第九次作业(带验证码的email)
    Jsp第八次作业
    Jsp第七次作业email
  • 原文地址:https://www.cnblogs.com/krislight1105/p/3748339.html
Copyright © 2020-2023  润新知