我使用的是ReportLab3.2和Python2.7。 我试着把一些文本放在一个圆形的面板上,像这样:
但我得到了: 我尝试过使用borderRadius,但它无法使拐角变圆:
ps_title2 = ParagraphStyle(styles['Normal'],\
fontName=helper.REG_FONT, fontSize=18, textColor=DARK_BLUE,\
leading=22, backColor=LIGHT_BLUE, borderRadius=15)
pr2 = Paragraph('Interpretation summary<br/>something<br/>another thing', ps_title2)
pr2 = Paragraph('my paragraph<br/>something<br/>another thing', ps_title2)
elements.append(pr2)
我知道另一种方法是使用表格,知道如何制作表格,将信息放在表格中,但不知道如何使表格的角变圆。 画画布不是一个好主意,因为我不知道该节的坐标,因为它会根据内容的长度而改变。 有什么办法让拐角变圆吗?在
我查看了代码,发现当未设置border color时,border radius将不起作用;还需要设置borderWidth和borderPadding。 以下是有效的方法:
相关问题 更多 >
编程相关推荐