在Javafx TableView上自动水平滚动

如果我在桌子上向右滚动,它将自动向左滚动。我没有自己的滚动实现,所有操作都由TableView完成。有没有人见过这个?如果我在Windows上进行测试,则没有问题。

compile "org.javafxports:jfxdvk:8.60.13"
javafxportsVersion = '8.60.13'
iCMS 回答:在Javafx TableView上自动水平滚动

此问题与javafx更相关。如果设置了“ IS_TOUCH_SUPPORTED”标志,则使用后(VirtualFlow)滚动条将设置为可见的false。更改侦听器onVisible然后执行updateHbar()。并且由于hbar.isVisible(),滚动var值设置为0。 我不想更改“ IS_TOUCH_SUPPORTED”。这就是为什么我创建自己的外观,仅创建自定义虚拟流程的原因。自定义虚拟流程也非常简单,我只通过反射将tempVisibility设置为true。而且我还覆盖了startSBReleasedAnimation()方法,并且在内部不执行任何操作。

public class CustomVirtualFlow<T extends IndexedCell<?>> extends VirtualFlow<T> {

public CustomVirtualFlow() {
    super();

    try {
        final Field field = VirtualFlow.class.getDeclaredField("tempVisibility");             
        field.setAccessible(true);

        field.setBoolean(this,true);
    } catch (final Exception e) {       
    }
}

/*
 * (non-Javadoc)
 *
 * @see com.sun.javafx.scene.control.skin.VirtualFlow#startSBReleasedAnimation()
 */
@Override
protected void startSBReleasedAnimation() {
    // do not call the super.startSBReleasedAnimation()
}
本文链接:https://www.f2er.com/2204696.html

大家都在问