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>
    



  • 相关阅读:
    这个是我得标题:1548669163
    Mahout学习
    MySQL
    Ubuntu
    java小程序100例
    java实现链表从尾部输出
    空格替换
    java 实现二维数组查找
    JAVA实现分页
    java 程序参数详解
  • 原文地址:https://www.cnblogs.com/krislight1105/p/3748339.html
Copyright © 2011-2022 走看看