-
Notifications
You must be signed in to change notification settings - Fork 853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
怎么单独设置Column的背景 #21
Comments
绘制单个 格子背景是
|
@huangyanbin 如果要绘制自定义背景该怎么写呢? |
如果你想要绘制圆形或者其他,你可以使用table.getConfig().setContentBackgroundFormat(ICellBackgroundFormat),重新接口方法就可以,可定制自己想要的背景效果,其实BaseCellBackgroundFormat就是个绘制Rect的实现类。 |
知道了,之前也看到这个方法了,没发现可以通过cell.column得到列的信息,以为只能对所有列统一处理。感谢 |
@huangyanbin BaseCellBackgroundFormat只有getBackGroundColor,没有getBackGroundDrawable之类的,要怎么实现呢 |
你想要绘制图片之类的,必须用实现ICellBackgroundFormat接口,然后自己绘制图片,绘制图片很简单,网上一大堆。 |
好的。真是太感谢了 |
需求是根据值设置cell的背景,值不为空的cell将其背景设置为红色。代码如下,得到的结果是所有cell都变红色了,并且覆盖了文本值。
`column4.setDrawFormat(new TextDrawFormat() {
The text was updated successfully, but these errors were encountered: