- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想知道是否有任何“简单”的方法可以将垂直滚动条设置为在按下按钮时或实际上在发生任何事件时“滚动”特定量。
例如,我有一个具有侧边栏的应用程序,侧边栏上的选项之一是“设置”。设置有子项目,我想添加单击其中一个子项目的功能,它将打开“设置”页面并自动向下滚动到该子项目所在页面上的特定点。
最佳答案
要以编程方式垂直滚动 ScrollPane
,只需操作 vvalue
属性(property)。这是该属性的文档:
The current vertical scroll position of the ScrollPane. This value may be set by the application to scroll the view programatically. The ScrollPane will update this value whenever the viewport is scrolled or panned by the user. This value must always be within the range of
vmin
tovmax
. Whenvvalue
equalsvmin
, the contained node is positioned so that its layoutBoundsminY
is visible. Whenvvalue
equalsvmax
, the contained node is positioned so that its layoutBoundsmaxY
is visible. Whenvvalue
is betweenvmin
andvmax
, the contained node is positioned proportionally between layoutBoundsminY
and layoutBoundsmaxY
.
关于JavaFX - 如何在单击按钮时以编程方式滚动 ScrollPane?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59566201/
我有带左侧和中心部分的 BorderPane,两者都是 ScrollPanes。如何使用一个滚动条(垂直)滚动它们。或者如何访问其中一个滚动条? 最佳答案 @invariant 的回答对我不起作用。但
在许多 android 应用程序中,我遇到了“列表的粘性标题”标题,我们喜欢它。 https://github.com/search?q=header+sticky+android ,现在,我正在尝试
我正在尝试从一个可平移的 ScrollPane(“子”)中“拦截”拖动事件,并将该事件重定向到另一个 ScrollPane(“父”)。 这是我这样做的尝试: import javafx.applica
我想知道 JavaFX 8 中是否有一个 ScrollPane 属性可以用来监听当前在给定时间显示的组件。 例如, ScrollPane 有一个 VBox,它有 8 个按钮。在滚动 Pane 中只能看
我有一个 scrollPane 可以通过按下按钮来滚动,使用下面的代码 @FXML public void scrollUp(ActionEvent event) { if (scrollPa
我想要实现像下图这样的结果,其中滚动条始终靠近“执行”按钮。 但是当我调整它的大小时,滚动 Pane 不遵守其约束例如 这是我的 FXML 代码:
我想知道是否有任何“简单”的方法可以将垂直滚动条设置为在按下按钮时或实际上在发生任何事件时“滚动”特定量。 例如,我有一个具有侧边栏的应用程序,侧边栏上的选项之一是“设置”。设置有子项目,我想添加单击
使用 groovy 的 SwingBuilder 设置滚动 Pane 的正确方法是什么?我正在使用 griffon,但我很难动态添加和删除组件... 这是我在 SwingPad 中尝试过的一个片段。它
我使用以下代码将 ScrollPane 中的 Applet 包含到我的 Eclipse 插件 View 中: @Override public void createPartControl(C
我在渲染 JavaFX 滚动 Pane 时遇到了问题。有时,当我滚动 Pane 时,所包含的 View 看起来“撕裂”或只是缺少某些细节。如果用户更改应用程序中的当前焦点(即通过单击新元素),则可以修
我正在为我的游戏创建一个商店,但我遇到了 libgdx ScrollPane 问题。它似乎将其中的表格向下移动了 155 像素。它所产生的效果是,表格显示在距顶部大约 155 像素的位置,并且无论我向
首先,可能有些人已经问过这个问题。不过,我确信我无法用谷歌搜索它。不管怎样,我有一个scrollPane,它有一个textArea 的viewPortView。我的问题是,当我在文本区域中插入大量组件
我想将 StackPane 作为我的根 Pane 。我想要一个scrollPane 作为场景中间的一个小盒子,并在容器下方有两个按钮。 我试图通过编写以下代码来实现它: private StackP
我有这个类(class)作为我的问题的一个例子。滚动 Pane 不滚动,我看不出一个很好的理由: import java.awt.Dimension; import javax.swing.J
我尝试使用: scrollPane.setStyle(".scroll-pane > .viewport { -fx-background-color: red; }"); 但它不起作用。我很确定我做
在我的代码中,我调用了一些项目(我的按钮名称指向不同的项目。名称和所有内容都来自数据库)我想要一个 J ScrollPane 围绕我的按钮,我该怎么办?我只想在滚动 Pane 内调用按钮。这是我的代码
我发现如果我在触摸设备上的 JavaFX 应用程序的 ScrollPane 内滑动,滚动动画会非常慢。我没有在 ScrollPane 的 ScrollBar 上滑动,而是在内容本身内滑动。 如何加快滑
我制作了一个包含 TextArea 的 ScrollPane。当TextArea通过push()方法获取额外文本时,需要将滚动条设置到底部。但是,当使用 push() 时,条形图会设置为顶部。我不知道
我有一个 VBox,我已向其中添加了 50 个标签。考虑到它包含在 ScrollPane 中,我认为它允许我向下滚动以查看其余数据,但它不允许这样做。 当我通过场景生成器构建它时,它被配置为 XML。
我可以在 JavaFX 中简单地创建一个只水平滚动的滚动 Pane ,如下所示: ScrollPane scroll = new ScrollPane(lcp); scroll.setPannable
我是一名优秀的程序员,十分优秀!