I would like to hide or remove vertical scrollbar in my TableView. I would like to menage scroll with my own PgUp/PgDown buttons.
Buttons work fine with below code, but the verticalScrollBar ruin the desired aspect. How can I hide/remove it?
btnPgDown.setOnAction(e -> {
if (table.getSelectionModel().getSelectedIndex() == -1) {
table.getSelectionModel().select(0);
}
Event.fireEvent(table, EventUtil.PG_DN_PR_EVENT);
table.requestFocus();
});
Note: the EventUtil.PG_DN_PR_EVENT emulate the PgDown key event.
I think the best way to hide the scroll bars of a TableView is with CSS code.
This is the code for the vertical scroll bar.
.table-view *.scroll-bar:vertical *.increment-button,
.table-view *.scroll-bar:vertical *.decrement-button {
-fx-background-color: null;
-fx-background-radius: 0;
-fx-background-insets: 0;
-fx-padding: 0;
}
.table-view *.scroll-bar:vertical *.increment-arrow,
.table-view *.scroll-bar:vertical *.decrement-arrow {
-fx-background-color: null;
-fx-background-radius: 0;
-fx-background-insets: 0;
-fx-padding: 0;
-fx-shape: null;
}
If you want to hide also the horizontal scroll bar, you have to add the same code but changing *.scroll-bar:vertical for *.scroll-bar:horizontal.
And if you want to scroll your table by code, I recommend to use the method scrollTo that it's included in the TableView class.
From what I can tell based on my own experiences, whether a TableView displays a ScrollBar or not depends on the buttons and arrows on the ScrollBar.
In my project I use this CSS code to hide both scrollbars
.table-view *.increment-button,
.table-view *.decrement-button,
.table-view *.increment-arrow,
.table-view *.decrement-arrow
{
-fx-padding: 0;
-fx-shape: "";
}
But this has sideeffects, since apparently the TableMenuButton uses the same padding the TableMenuButton disappears with a padding of 0, the only thing I keep seeing is one half of the "+" sign that is usually displayed on the button. So this is a way but not neccesarily the way.
Related
Why PKAddPassButton isn't showing icon?
This happens in both cases when button is single line expanding to entire stack view width
and when it is double line inside UIView container with centreX constraint.
Setting frame or width doesn't change anything.
private lazy var addPassButton = UIViewFactory.create.container().apply {
let button = PKAddPassButton()
$0.addSubview(button)
button.snp.makeConstraints { make in
make.top.bottom.equalToSuperview().inset(16.0)
make.centerX.equalToSuperview()
}
}
On real device all works correctly. Icon not showing only on simulator.
I have an app which has a floating header. TinyMCE renders the sticky toolbar underneath this when I scroll because it positions it fixed at top: 0
Is there a mechanism/hack to add offset to this so that the sticky toolbar can sit below the header?
Thanks
It's not the perfect solution.
div.tox-tinymce--toolbar-sticky-on div.tox-editor-header {
top: 40px !important;
}
I'm trying to figure out how I can scroll to bottom and only scroll to bottom if the scroll position is at the bottom, like XCODE.
I can't figure out how I can get the current scroll position of an NSTextView.
It's simple to just scroll to the bottom using:
self.tbLog.scrollToEndOfDocument(nil)
But this happens every time and if you are scrolled up to the top of a log file and a new line is added, it drops back to the bottom. I only want to drop to the bottom if the scroll position is at the bottom.
SOLUTION:
// Add your text to the NSTextView here... then...
print("Position: \(NSMaxY(self.tbLog.visibleRect) - NSMaxY(self.tbLog.bounds))")
if (NSMaxY(self.tbLog.visibleRect) - NSMaxY(self.tbLog.bounds) == 0.0) {
print("we're at the bottom, keep at the bottom.")
self.tbLog.scrollToEndOfDocument(nil)
} else {
print("we're scrolled up somewhere... do nothing.")
}
How to remove/hide the scroll bar indicator (vertical stick that's shown when scrolling) in ionic 3
I have tried: not sure what the below code does
.scroll-content {
overflow-y: auto !important;
}
try this:
::-webkit-scrollbar {
display: none;
}
::-webkit-scrollbar is only available in WebKit-based browsers (e.g., Google Chrome).
I would like to know how can I fix the height of a view so it can take full height of the device screen (iPhone only) minus the height of the tabar.
well I would click the UIView in question then towards the bottom right there is an icon looks like |o| (kind of)....its the pin menu
tap that
and make sure the top and bottom are solid orange...not the faded semi dotted orange and then put 0 in each of them
what do you mean by "tabar" ...are you referring to the status bar where the time and wifi signal are etc?
Response to comment
if you add the navigation bar first, then add the view and physically drag the bounds to the top left top right bottom left and bottom right and then do what i said it should have desired effect
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
let rect : CGRect = (self.navigationController?.navigationBar.frame)!
let y = rect.size.height + rect.origin.y
self.view.contentInset = UIEdgeInsetsMake(y, 0, 0, 0)
}
This is the best example I can provide, since you didn't specify much. This adjusts the bounds of view if the view controller has a navigation bar
You can also apply layout constraints (auto resizing) which are in the inspector menu.
Apply all 4 side constraints to make your view always full size for all the devices.