gwt grid header align

时间:2016-04-25 09:01:05

标签: java gwt alignment gxt

I used to gwt 2.5.1, java 1.6.

when used grid, I want to centerd just grid header. No data, Only Header.

Source

  .getGrid().getColumnModel().getColumns().get(i).setAlignment(HorizontalAlignment.CENTER);

But, Both are aligned.

So, What Can I do?

Thank you.

1 个答案:

答案 0 :(得分:0)

使用DOM检查器并删除与标题单元格对应的样式。 如果您将列命名为“test”,则样式可能会命名为“x-grid3-td-test”。

将以下内容添加到样式表中:

<?xml version="1.0" encoding="utf-8"?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@android:id/background"
          android:top="5dp"
          android:bottom="5dp">
        <color android:color="@color/red"/>
    </item>
    <item android:id="@android:id/progress"
          android:top="5dp"
          android:bottom="5dp">
        <clip>
            <color android:color="@color/blue"/>
        </clip>
    </item>
</layer-list>