Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我刚刚发现,在 swt tableviewer 中对齐图像是不可能的。如果它的 labelprovider 为其返回图像,则使用 SWT.RIGHT(例如)创建一个 TableColumn 对该列没有影响。问题:有没有其他方法可以对齐图像而不是修改图像文件本身并在其中添加一些额外的像素?
我相信您遇到了底层平台的限制(或类似的东西)。如果您自己绘制,您可以完全控制进入单元格的内容。有一个片段向您展示如何执行此操作。
表格示例片段:在表格项的右侧绘制图像
当然,您还必须在单元格中绘制您想要的任何文本。