如何在 Android 布局中降低操作栏的高度

How To Reduce Height of Action Bar in Android Layout

我试了很多代码,都没找到完美的答案。在这里我来问问大家如何在特定的布局中改变action bar的高度。我正在使用 Appcompat 主题,我的编码是,

Styles.xml

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">#FF4081</item>
        <!-- Customize your theme here. -->
    </style>

</resources>

创建新主题并使用它: How to change action bar size

或使用 Android 开发者网站:http://developer.android.com/reference/android/app/ActionBar.LayoutParams.html