在Android中设置自定义选项卡框架
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,但是确实有点麻烦。选项卡小部件的布局使用固定高度,因此您必须直接更改该布局。一种方法是扩展
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 theaddView
method and change the widgets according to your needs.