- All Known Implementing Classes:
AndroidKeyboardService
,DummyKeyboardService
,IOSKeyboardService
public interface KeyboardService
With the keyboard service, you can query the height of the software
keyboard, whenever it becomes visible.
Example
KeyboardService.create().ifPresent(service -> {
service.visibleHeightProperty().addListener((obs, ov, nv) ->
System.out.println("height: " + nv));
});
Android Configuration: none
iOS Configuration: none
- Since:
- 4.0.7
-
Property Summary
TypePropertyDescriptionjavafx.beans.property.ReadOnlyFloatProperty
Gets the visible height of the Keyboard, so scene or views can adjusted to prevent some of their content from being covered by the keyboard. -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<KeyboardService>
create()
Returns an instance ofKeyboardService
.void
keepVisibilityForNode
(javafx.scene.Node node) Node is adjusted vertically when software keyboard shows up, so it is visible and not covered by it.void
keepVisibilityForNode
(javafx.scene.Node node, javafx.scene.Parent parent) Node is adjusted vertically when software keyboard shows up, so it is visible and not covered by itjavafx.beans.property.ReadOnlyFloatProperty
Gets the visible height of the Keyboard, so scene or views can adjusted to prevent some of their content from being covered by the keyboard.
-
Property Details
-
visibleHeight
javafx.beans.property.ReadOnlyFloatProperty visibleHeightPropertyGets the visible height of the Keyboard, so scene or views can adjusted to prevent some of their content from being covered by the keyboard.
-
-
Method Details
-
create
Returns an instance ofKeyboardService
.- Returns:
- An instance of
KeyboardService
.
-
keepVisibilityForNode
void keepVisibilityForNode(javafx.scene.Node node) Node is adjusted vertically when software keyboard shows up, so it is visible and not covered by it. For that, the root parent will be moved accordingly.- Parameters:
node
- the Node to adjust, so it is always visible
-
keepVisibilityForNode
void keepVisibilityForNode(javafx.scene.Node node, javafx.scene.Parent parent) Node is adjusted vertically when software keyboard shows up, so it is visible and not covered by it- Parameters:
node
- the Node to adjust, so it is always visibleparent
- the Parent of the node that will be moved
-
visibleHeightProperty
javafx.beans.property.ReadOnlyFloatProperty visibleHeightProperty()Gets the visible height of the Keyboard, so scene or views can adjusted to prevent some of their content from being covered by the keyboard.
-