简体   繁体   English

如何在AppCompat ActionBar中更改项目的高度?

[英]How change height for item in AppCompat ActionBar?

I changed color for text and background by this code: 我通过以下代码更改了文本和背景的颜色:

    <style name="AppTheme" parent="Theme.AppCompat.Light">
    <item name="android:itemBackground">@color/itemBackground</item>
    <item name="android:itemTextAppearance">@style/TextAppearance</item>
</style>
<style name="TextAppearance">
    <item name="android:textColor">@color/actionMenuTextColor</item>
    <item name="android:textSize">16sp</item>
</style>

How can I change height for menu item like below? 如何更改以下菜单项的高度?

在此处输入图片说明

Code for this menu: 此菜单的代码:

<menu 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">
<group android:id="@+id/group_hide_on_focus">
    <item
        android:id="@+id/test4"
        android:title="test4"
        app:showAsAction="never" />

    <item
        android:id="@+id/test2"
        android:title="test2"
        app:showAsAction="never" />

    <item
        android:id="@+id/test3"
        android:title="test3"
        app:showAsAction="never" />
</group>

which menu height do you want to change ? 您要更改哪个菜单高度? can you be more specific ? 你可以说得更详细点吗 ?

and have you considered using android:layout_height="xdp" 并考虑使用android:layout_height =“ xdp”

replace "x" with whatever height you want.... example : 50dp or so... 用任意高度替换“ x”。例如:50dp左右...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM