TableView with inset grouped style: Have rounded corners even with hidden cells - objective-c

I have a table of the type inset grouped style. Depending on some selections I want to hide some cells by reducing their height to 0. Now is there anyway to still show rounded corners even if the respective cell has height 0? Or how would you do that? I don't want to "delete" the cell, otherwise it is much more complex to keep track of the cells for me.

Related

Programmatically add a border to WKInterfaceGroup - Solved

Is it possible to give a WatchKit table cell or WKInterfaceGroup a border width of 2px and a red border color? If not, are there any work-arounds?
It can't be done programmatically, but you can give the impression of a boarder in IB.
Add a separator above and below the cell's sub-group.
Give the cell's main group a background color.
Make the first separator an alpha of 0 and a top vertical alignment.
Give the cell's sub-group a center vertical alignment.
Give the second separator an alpha of 0 and a bottom vertical alignment.
I'm pleased with the result.

Design tableViewCell( overlaps table view cell)

How to design this table view cell..
Cell overlaps the another cell.
Please help me
Set the y offset of the pictureImageview to be negative i.e -50.0f or so, the image will appear as starting from the cell above.
I just tried AppleDelegate's solution but didn't work, because the top of every image is cut, maybe because it is beyond the cells bounds, even with clear color for background.
A different approach would be to believe that it's just a visual effect, and cells are not overlapping. This is possible by giving a different height for every cell with next code :
- (CGFloat)tableView : (UITableView *) tableView
heightForRowAtIndexPath : (NSIndexPath *) indexPath {
// RETURN A DIFFERENT HEIGHT FOR EVERY CELL DEPENDING ON INDEXPATH,
// INCREASING IT GRADUALLY.
}
In the next image, the black lines look like cells' top border, but maybe that's the effect, and the real limit is the red line :
Thinking this way, only the first cell requires a special treatment for the green titles.
Try setting constraints in storyboard and then keep the UIImageView's size/frame of image same when the image is set to UIImageView. Good Luck!

FlowPane height change measurements

I have a Stage as a form with a FlowPane. I just add Strings to the FlowPane. The main target with the flowpane is to create a "Tag" like control. This Tagcontrol is in the middle of the form.
Without or only one/two items the FlowPane should only have the same height as a TextField. When adding more and more Strings the FlowPane should increase its height till a certain maximum. While increasing the height of the FlowPane till its maximum also the height of the Stage should grow.
Now: how do I get the needed delta-height of the FlowPane when adding more and more items. For example on the first row I have two strings, on the second row i could right 5 strings depending of the string-length. If I have the delta i can use this to increase the height of the Stage easily.. but I am stuck with this calculation of flowheight-change.
I just messed around somewhere else in the code. You can just bind the height of the flowpane and you're good.

AQGridView: How to adjust UIGridViewCell margin

I'm trying to implement the AQGridView in my iPad app. Please see my below image -- sorry for the strong colors, but I think it would help you understand my problem.
Each cell (the blue box) has a margin left and right (yellow color), i.e. 8 pixels. This means that the first yellow coloum has a width of 8px, the second 16px, third 16px, and the last 8px. That's maybe fine in some situations, but I would like the yellow columns to have the same width. In my example the total width of the columns are 48 (8+16+16+8) so instead I would like each column to have a width of 12 (48/4). How can I change the AQGridView to do this?
I've tried to change the frame and bounce the AQGridView, but that did not do anything.
AQGridView actually takes the container view's coordinates and creates a strictly-defined grid from that. So when you have a 768px-wide grid view, and items which are a little under 1/3 of that in width, then it will create a rigid grid in which to place these items. By default your AQGridViewCell views will be centred within each grid square (although you can call -setResizesCellWidthToFit:YES to change that); you can adjust that positioning by implementing -gridView:adjustCellFrame:withinGridCellFrame: in your AQGridViewDelegate implementation.
In your case, every single cell has a margin of 8px on its left and right sides. On the outer edges this is seen alone, but in between pairs it appears doubled to 16px (8px from each cell).
What you want, then, is for each cell to have a 6px margin, and for the grid itself to have another 6px of margin space to the left & right of all cells. There's an API for this:
#property (nonatomic, assign) CGFloat leftContentInset;
#property (nonatomic, assign) CGFloat rightContentInset;
What you should be able to do is set myGridView.leftContentInset = 6.0; and myGridView.rightContentInset = 6.0;. The grid view will then lay out cells with a content width of 756px instead of 768px, which should give you a 6px margin around each cell. Combine that with the 6px left & right content insets and you'll have a clean 12px visible margin between every cell and the outer edges of the grid view.
Side note: the content inset properties were actually created to assist with laying out a certain number of cells per row. For instance, 1024 doesn't divide by 5, so it could end up with some fairly small cells being quite spread out since the layout grid would only contain 4 items in width. However, by adding left & right content insets of 2px each, the view would use a width of 1020 to calculate its layout grid, resulting in 5 cells per row. This is, in fact, exactly what we do in the Kobo iPad app when rotated to landscape mode; without that change, our portrait-mode 4 items per row just got spread out & it looked a little too sparse.
I managed to gain more control on the horizontal and vertical spacing by using the portraitGridCellSizeForGridView method and returning a slightly large CGRect compared to the one I used to initialise the cell in the gridView:cellForItemAtIndex: method.
I hope this helps.

set scroll last UItableview cell

when I scroll position end of UItableview the last UItableview row seems half. how can I show the last row fully and how can I detect scroll to last row?
I don't know what you mean by "seems half". I suppose that means only half of the cell is shown? Make sure the frame of the whole table view is visible first.
If you want a cell to appear within the bounds of the table view, use
[tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:? section:?]
atScrollPosition:UITableViewScrollPositionBottom animated:YES];
I think there is something (like a tabBar) at the bottom of your screen and it is overlapping the UITableView .. am I right, am I right?!
Just make the frame of the UITableView 48 pixels shorter. That's the average size of a tabBar..
Or perhaps you have not taken in account that the bar at the top (the status bar) also counts, which is about 15 pixels high. In that case, take 15 pixels of the height of your UITableView's frame.