In a UITableView, I am having a set of values, some of which have a value longer than the width specified/drawn. I want a way to show the full value on hover over that cell, like we have on web pages.
Please advise a way to achieve this.
Since you really can't hover on a touch phone, I would use a UILongPressGestureRecognizer and have the action display a smaller subset view on the screen over the table view with the cells details.
Related
In my tvOS-app I use a tableView with custom cells. If the cell is higher than the TV-screen it will show the "center-part" of the cell (top and bottom are not visible) and scrolling up or down will center the cell above or below. Is it possible and if, how, to change the "jumping" from cell to cell to a smooth scrolling like in iOS?
You should limit your cells to use a fixed height for a few lines of text and show focus. When a user selects one of the cells you can then expand / zoom / transition to show the whole text is a specific scrollable text view. This interface maintains the users understanding of content, lists and block text.
Just found the solution. Knowing what to search could be an advantage ;-)
Adding this simple line gives me the handling like in iOS:
self.tableView.panGestureRecognizer.allowedTouchTypes = #[#(UITouchTypeIndirect)];
I want to add a small indicator (like a green arrow or small circle) to indicate to the user what to do next in my iPad app (apparently some of the users can't figure what to do first, even tho' I have instructions in a drop-down help file). The indicator would be visible on the left side of the row and only on the row which would be the next action to take (user should tap that row to get the next sub-view to appear).
Any ideas how to accomplish this? (I looked on SO and Google and didn't find anything that was pertinent).
Add an image view to your prototype table cell. When you want to indicate that a given row is the next thing to do, set the image of the image view for that row to your indicator image.
I would like to create a NSTableView so that when it grows it will not scroll but instead push down the content below. The NSTableView and the content below will be wrapped in a NSScrollView that will autoresize with the windows height.
Is this even possible? I've spent a lot of time searching for any answer or even a clue on how to approach a design like this, but no luck. Should I even use a NSTableView for this?
See this image if you don't understand what I mean:
I think that you just need to calculate the total height of your all table cells and that value set as a table height. After that set your scroll view content size as a CGSizeMake(scrolviewwidth, table_height)
Select tableView and in attributes inspector in section Scroll View uncheck Scrolling Enabled. It is possible, that you will have to set table height manually viz previous answer.
I have a UITableView which is composed of custom cells. There are 21 cells containing text fields.
When I try to scroll and edit the cells at the bottom of the UITableView, I can't manage to get my cells properly positioned above the keyboard.
Also i created a custom cell class separately for my cells. So keyboard delegates are available on that class only.
I have seen many answers talking about changing view sizes,etc... but none of them has worked nicely so far.
Could anybody clarify the "right" way to do this with a concrete code example?
There are three approaches to this problem all of which tie into the keyboard did / will show notification....
When the keyboard appears, you move the whole view (including tableview) up to ensure the selected textfield is shown on screen, you can calculate this by getting the keyboard height (from the notification) and the textfield position.
You can resize the tableview so that it is only as big as the portion of the screen not covered by the keyboard, again get the height from the notification.
You can set the content inset for the tableview (for the bottom value) to the height of the keyboard.
If you need to, when resizing or repositioning the tableview, you may need to set it to scroll the content to the rect of the text field to ensure it is in view...
- (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated;
I want to customize my NSTableView. My overall requirements are like this:
Each row will have one image and some text; images and text could be different.
Some cells might not have an image.
Row height is dependent upon some external factor.
A cell shouldn't draw the background, it should show the NSTableView background.
So far I am able to draw transparent cells with some text. I Googled and found out I need to customize each cell. Now I have this question: should I maintain two columns or should one column be okay, having one image on the left hand side and text adjacent to that?
I also understand that I need to override two methods:
- (void) drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
So for each cell, I need to draw/construct the cell -- can anyone guide me? Am I going in the right direction? Can I achieve a transparent background with dynamic height with the above approach?
Each row will have one image and some text,
So, two columns—one with an image cell, the other with a text field cell.
images and text could be different,
I should hope so.
Some cell might not have the Image,
Not a problem.
Row height is depend upon some external factor,
Be the table view's delegate, and it will ask you what the row's height should be.
Cell shouldn't draw the background,
It won't unless you set it to do so.
it should overall it should show the NSTableView background,
The table view will draw its own background anyway, which you can set in IB's Inspector. If you wanted the table view to not draw a background, you would set its background colors to the clear color.
You don't need a custom cell for any of this.