简体   繁体   English

尝试更改操作栏大小

[英]Trying to change action bar size

Ive been learning app development and have been working through XML. 我一直在学习应用程序开发,并且一直在研究XML。 Now i am trying to find how to change the action bar size so far everything ive read has pointed me towards these lines of code. 现在,我试图找到如何更改操作栏大小的方法,到目前为止,我读过的所有内容都将我引向了这些代码行。

    <item name="android:actionBarSize">15dp</item>

or 要么

    <item name="android:height">@dimen/bar_height</item>

The problem with them is that i get this error 他们的问题是我得到了这个错误

    error: Error: No resource found that matches the given name: attr 'height'.

or for the first one i get the same thing but with actionBarSize. 或第一个我得到相同的东西,但具有actionBarSize。 When i start typing android the suggestions come up and nothing related to what i want to do pops up. 当我开始输入android时,建议就会出现,并且与我要执行的操作无关的任何内容都会弹出。 The only code i have is what is generated when you start up the app. 我唯一的代码是启动应用程序时生成的代码。 I am trying to learn how to edit aspects of whats pregenerated please help. 我正在尝试学习如何编辑预生成内容的各个方面,请提供帮助。

Add this to your Toolbar : 将此添加到您的Toolbar

android:layout_height="@dimen/actionBarSize"
android:minHeight="@dimen/actionBarSize"

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

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