ActionBar 选项卡高度 [英] ActionBar tabs height

查看:21
本文介绍了ActionBar 选项卡高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改默认 ActionBar 选项卡的高度,但找不到任何相关信息.是否有一些样式属性或方法来设置选项卡的高度?谢谢.

I want to change default ActionBar tab's height, but can't find any info about. Is there some style attribute or method to set height of tabs? Thanks.

推荐答案

这就是标签的样式.虽然,我实际上很难改变高度.我不确定您是否可以通过样式为 TabView 设置高度.您可能必须创建自定义视图并将其应用于代码中的选项卡.您需要引用的所有样式和属性都在 SDK 中.查看您正在使用的平台版本的 Values 文件夹.这就是我通常了解如何执行此操作的方式.

This is how you style the tabs. Although, I was having trouble actually getting the height to change. I'm not sure you can set a height via a Style to the TabView. You may have to create custom View and apply that to your tabs in your code. All the styles and attributes you need to reference are in the SDK. Look in the Values folder of the platform version you're working with. That's how I typically find out how to do this.

<style name="Widget.Holo.Tab" parent="@android:style/Widget.Holo.Light.ActionBar.TabView">
    <item name="android:height">#dp</item>
</style>

<style name="Your.Theme" parent="@android:style/Theme.Holo.Light">
    <item name="android:actionBarTabStyle">@style/Widget.Holo.Tab</item>
</style>

这篇关于ActionBar 选项卡高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆