Android的标签不带图标 [英] Android Tabs without icons

查看:145
本文介绍了Android的标签不带图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置我的标签如下:

 spec = tabHost.newTabSpec("tab1").setIndicator("Tab 1").setContent(intent);
    tabHost.addTab(spec);

而现在我有没有图标,只有一个标题标签,但它只是叶子与底部的标题的图标大小的空白 - 我想在XML调整layout_height,但随后的文字是走了因为它呈现的分界点之下。

And now I have a tab that has no icon, only a title, but it just leaves an icon-sized blank space with the Title at the bottom - I tried adjusting the layout_height in the xml, but then the text is gone because it is rendered below the cutoff point.

我如何更改标签的大小,并没有图标都显示的标题?

How can I change the size of a tab, and have the title displayed without an icon?

推荐答案

答案很简单:你不能。默认的Andr​​oid标签永远离开形象某些空白。
但是你可以创建自己的选项卡中的默认选项卡,以弥补该限购。这里是一个非常好的教程创建自定义选项卡。

The answer is simple: You can't. The default android tab will always leave some blank space for the image. But you can create your own tabs to compensate that "restriction" in the default tab. Here is a very good tutorial to create custom tabs.

http://joshclemm.com/blog/?p=136

祝你好运,
Arkde

Good luck, Arkde

这篇关于Android的标签不带图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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