ExpandableListView - 组标志是拉伸以适应文本大小 [英] ExpandableListView - group indication is stretch to fit the text size

查看:356
本文介绍了ExpandableListView - 组标志是拉伸以适应文本大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有组标志的小图标,我用groupIndicator调用选择画,但我看到在默认情况下拉伸的的android图标,配合文字的大小

I have group indication with small icon, and i use groupIndicator to call the selector to draw it but I see android by default stretch that icon to fits the text size

我怎么能prevent的行为,并显示该图标与它的原始大小?

how can i prevent that behavior, and display the icon with it's original size ?

推荐答案

您可以通过 setGroupIndicator 方式添加组指示灯。但默认情况下,指标的Andr​​oid拉伸高度以配合集团项目的高度。 (宽度可以通过 setIndicatorBounds 方式进行调整。) 因此,你应该让组指标的高度完全相同组项目的高度。 (见 ExpandableListView

You can add group indicator by setGroupIndicator method. But By default, Android stretch height of indicator to fit group item's height. (width can be adjusted by setIndicatorBounds method.) Therefore, you should make group indicator's height exactly same as group item's height. (see ExpandableListView)

否则,您可以完全自定义组指标是 onGroupCollapsed onGroupExpanded 的方法。只要有一些国家的视图,当调用这些方法,改变你的看法的状态。 (见 ExpandableListAdapter

Otherwise, you can make fully customized group indicator with onGroupCollapsed and onGroupExpanded methods. Just make a view with some states and When these methods are called, change your view's state. (see ExpandableListAdapter)

这篇关于ExpandableListView - 组标志是拉伸以适应文本大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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