I have an interesting challenge. I have a JavaFX 8 TableView which seems to leak vertical borders of table cells in a selected row into the next or previous row. I have searched around and can't seem to find anyone who has come across the same. Not sure the image I uploaded actually displays, but it is a very thin line extending from a table cell's vertical border, but not all table rows exhibit this behavior.
I have applied the following CSS:
.table-row-cell:selected {
-fx-background-color: -fx-focus-color;
-fx-text-background-color: white;
}
.table-row-cell:selected-row {
-fx-background-color: -fx-focus-color;
-fx-text-background-color: white;
}
Related
I just successfully set up content inset adjustment to make visible, dealing with the keyboard of iPhone, of the active text field on a cell row managed by a tableViewController (dynamic table view and different custom cell types - some from XIB and others from code). Well... almost success; except for the below issue:
a section footer doesn't move up the same extent of the rows of the section so that often the footer makes the active text field invisible. A user has to scroll the table view a bit to show the row with the active text field (strangely the footer stays floating above the rows in scrolling).
Anyone has seen such weird thing before? Is it the section footer moving with the section rows together as an integral unit? How can the footer stay floating above the scrolling rows of the section? Please shed me some light and I even don't know where/how to start debugging such issue.
Thanks folks for editing my post. After many hours of struggling, I finally find the reason from reading pages of Apple document, which is of enum UITableView.Style having two cases:
.plain : Section headers and footers are displayed as inline separators and float when the table view is scrolled.
https://developer.apple.com/documentation/uikit/uitableview/style/plain
.grouped: Section headers and footers do not float when the table view scrolls.
https://developer.apple.com/documentation/uikit/uitableview/style/grouped
Apple should rename the enum to HeaderFooterStyle instead to make our finding easier (another example of clarity over brevity)
I hope someone else bumping into the headache might find the post useful.
Given that using the minimumInteritemSpacing / minimumLineSpacing settings on an iOS collection view creates a space rather than a solid border between cells, how can we style a solid border of consistent width around each cell in a collection view grid with a seperate colour applied as the background to the main collection view (so that after the border of the last cell a different background colour is visible) using these methods?
This is the best example of a solution I have seen so far but it is for objective C only rather than swift 3. The author also outlines the shortcomings of a couple of approaches I have already tried:
UICollectionView custom line separators
As an additional note the grid contains items of varying dimensions as illustrated here:
github.com/Antondomashnev/ADMozaicCollectionViewLayout
Edit - Here is an image of the effect I'm trying to achieve:
Custom CollectionView
It also highlights the problem that whil]1st the blue borders are most easily created using minimumInteritemSpacing / minimumLineSpacing the spaces created (whilst accurate and evenly spaced) just show the colour of the background view beneath the cells so you are left with one solid colour as opposed to the blue and yellow combination shown in the image.
I was able to get the result I wanted by setting a minimumLineSpacing and minimumInterimItemSpacing value of 0 to group the cells together and dynamically adding / removing borders as CALayers using krotov's answer here: UIView bottom border?
I have a Grouped Style table view in my application. When I set the accessoryType to UITableViewCEllAccessoryCheckmark everything is OK, but when i set it as UITableviewAccesoryTypeNone the right border is not shown, as it can be seen in the next image:
As it can be seen the two firs rows has Checkmark and are seen right, but the other can be seen the round corner that ends de section, and the other ones has not border.
Any suggestion to resolve the problem??
Best Regards.
I have a UITableView with a negative top content inset (-20). I use the negative inset for a shadow effect: The table header is a shadow gradient. The negative inset causes the shadow to only appear when the user is dragging the table down (similar to the Alarms table in the Clock app).
This works fine. Until I start reordering the rows (by standard UITableView reordering mechanism).
The instant I grab the first row, the whole table jumps down, so that the bottom edge of the last row is aligned to the bottom of the screen. This is a really weird glitch. When I release the row (at the same or some other position), the table stays in this strange, misaligned state. When I do some scrolling, the table returns to its original position.
This also happens for the other rows if I drag them to the top row. Reordering below the top row works fine. When I change the content inset to zero (or a positive number), the glitch does not occur.
It really seems like a bug in iOS (5.0) - unless I am missing something? Any idea how to work around this?
I'm also experiencing this exact issue in iOS 6.
I couldn't find a fix, but there's a workaround which might work if your table only has a single section. Basically, instead of setting the content inset to a negative value, you can set a negative section header height. This seems to have the same effect as the negative inset -- nudging the entire contents of the scroll area up -- without the glitches during reordering.
So instead of:
[tableView setContentInset:UIEdgeInsetsMake(-16, 0, 0, 0)];
Try:
[tableView setSectionHeaderHeight:-16.0];
This of course won't play well if you have content in section headers (or multiple sections in your table), but for single-section tables it seems to be a passable workaround.
One quick update since I don't have enough rep to comment yet:
The original bug this is trying to work-around appears to be fixed on iOS 7. I wound up wrapping my fix in a version-checking conditional for iOS <7 devices.
I just implemented drag and drop sort table on my site
Demo Link
On chrome sometimes the rows border change colors specially the bottom one it turns black and its pretty buggy.
Works fine on IE and Firefox
I also notice that my row is very small when dragging and it's not the actual size of the of the row. Any work around for this?
I'm sure that has to come because you do not use any CSS Reset...
and by the way, you should add border-top: none; to your td, th style right after you set the border, so you don't have border with 2px as the bottom of one will be added to the top of the other creating lines with 2px's and not a smooth 1px in every tr
Here is an updated version: http://jsfiddle.net/U22Bz/3/