动作条的标签高度高度、动作、标签

2023-09-12 21:46:42 作者:迟夏饮冰

我想更改默认的动作条选项卡的高度,但找不到任何信息。有一些样式属性或方法来设置标签的高度? 谢谢你。

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的高度。您可能需要创建自定义视图并将其应用到你的标签在你的code。所有你需要引用的样式和属性都在SDK中。看在你正在使用的平台版本的价值观文件夹。这就是我通常找出如何做到这一点。

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>
 
精彩推荐
图片推荐