在Android中设置自定义选项卡框架

发布于 2024-10-04 00:59:49 字数 105 浏览 0 评论 0原文

Android 可以设置标签的高度和宽度吗?我尝试将自定义的textview设置为tabspec的指示符,将其高度和宽度设置为不同的值,但无论其高度和宽度值是多少,它始终设置为默认的高度和宽度值。

Is it possible to set height and width of tabs in Android? I tried setting customized textview as the indicator of tabspec, setting its height and width to different values, but no matter what its height and width value is, it's always set to the default height and width value.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

公布 2024-10-11 00:59:49

是的,但是确实有点麻烦。选项卡小部件的布局使用固定高度,因此您必须直接更改该布局。一种方法是扩展 TabWidget,重写 addView 方法并根据您的需要更改小部件。

Yes, but it is quite a bit of a hassle. The layout for the tab widgets uses a fixed height, so you'd have to change that layout directly. One way of doing that is to extend TabWidget, override the addView method and change the widgets according to your needs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文