I have added content offset to my UITableView.
For better positioning of my Table and now, I would like to dismiss my UITableView When User taps on the Content Offset Part of My table view.
How can i add this?
Strictly i dont want to add anymore views above the table in my screen.
Have done like Reference to the answer
https://stackoverflow.com/a/39062209/5215474
Without seeing exact code, I would do the following:
Add a UIGestureRecognizer to UITableView
Use a combination of scroll position and the point touched in screenspace to determine if a touch happened where you want.
Related
a bit confused reading in the Apple documentation, tried multiple settings but no luck so far, so I hope to have a response here.
I am implementing a UICollectionViewController with header and vertical scrolling.
All work flawlessy but now I want to add a view in which I want to put an TabBar below the header and before the first line of the collectionview.
I want also that the tabBar moves when scrolling so i can't just add a subview and let it disapper once the scroll starts.
I suppose I have to set the spacing for the first line to be big enough and once done create a view, add the subview and create the tabbar inside of it.
Now the question , which sections of those I have to override? https://developer.apple.com/documentation/uikit/uicollectionviewdelegateflowlayout
Thanks.
A better approach will be to implement the view to be added as the first cell of collection view.
I have one UIViewController with two UIViews on it. In the Navigation bar, when one button is pushed one of the UIViews is displayed and when the other button is pushed the other UIView is displayed. I want to put a UITableView on one of the views. However, the UITableView requires the UIViewController to use the UITableViewDelegate and UITableViewDataSource. Having implemented this for my UIView (subview) containing the UTTableView, when I click on the button for the other view, which does not contain a table, I get errors and the application croaks.
I am assuming (possibly incorrectly) that my issue is that I am trying to use the same UIViewController for both subviews, but only one contains a table.
Question 1) Is it possible to do what I described above? Meaning, if I had a problem then something was not connected up correctly.
So, I went down a path of creating two separate UIViewControllers; one for each view. Not sure this is the smart approach. Now I am just looking for advice on the best way to do this. Thank you in advance for your help.
To be more clear about what I am trying to do. I want the blue view to be put where the pink view is when the first button on the bar is clicked and I want the yellow view to be put where the pink view is when the second button is clicked. Essentially the pink view will never be displayed and may not even need to be on the UtilityViewController.
Having each as a UIViewController (or a subclass thereof) is the way to go about what you are trying to do. The UITabBarController does this already: https://developer.apple.com/library/ios/documentation/uikit/reference/UITabBarController_Class/Reference/Reference.html
I'm not sure if it is possible to achieve, but my costumer wants that when user taps a table view cell, an animation of a UIView sliding from left to right is committed, leaving the content under the UIView visible.
My concern is about how to trigger gesture recognizer added to the upper UIVIew for the animation and do not enter in conflict with didSelectRowatIndex: table view delegate method.
Is it possible to achieve?
Mant thanks!
Search on CocoaControls.com for this kind of control, there are plenty of open-source code that does this already.
After searching for "cell" on www.cocoacontrols.com I can already find the following ones:
JBSlidingTableviewCell
LRSlidingTableviewCell
ZKRevealingTablecellView
DMSlidingCell
TISwipeableTableview
And there is probably more.
I want to create table view inside of UIViewController like a below picture (I mean the second screen)
what is the best solution? "creating UIViewController then tableView and inside of tableView having custom cell"?
would you please give me some hint?
Thanks in advance!
So basically you want the tableview to not fill up the entire space. Yes, you can surely do UIViewController, let it implement UITableViewDelegate and UITableViewDataSource protocols, throw in a tableview and hook up the protocols, and use custom cells.
If you only want the tableview to not fill up the space horizontally (but it can still scroll all the way until it reaches your navbar), then you can just create a UITableViewController, and set up your cell background in the way you want. More specifically, you create 640px (or 320px) wide background images still, but only the central 600px, say, is filled in. The 20px to the right and left are transparent. (You need png to do this, of course) If you apply this background to your cells and apply another background to your self.view, then you can actually see your view background under the 20px on the two sides.
Note that if you choose the second approach, the cells are still full width; it's just that you are visually making them look like narrower. That's perfectly ok, but you need to customize your highlight background, too.
Looking at your picture, it seems you need to create UINavigation Controller as your parent view controller and add UITabBarViewController as its rootview. then in your second tab when your click on the cell inside the table, you pushview to another view which displays your picture
create a tab bar controller project. Every tabbar item will be a navigation controller.
Tat way u can manage both the navigation and tabs.
I'm not asking how to do this, it's more in line of "What would you call this?".
I have an NSTableView with several custom cells. I want the table to scroll row by row, meaning that when I move the scrollbar up I want the top row to disappear and when I move it down I want the bottom row also to disappear - I don't want to see half my cell.
How do you call this type of behavior? And can you share some pointers if you've implemented it in a NSTableView?
I'm not exactly sure what this would be called (maybe something like "constrained scrolling"?), but you can do it using NSView's -adjustScroll: method.
The general approach is that you need to make a subclass of NSTableView (if you don't already have one), and override this method to return a NSRect that has its origin.y value constrained to a multiple of your row height.
You probably also want to use NSScrollView's -setVerticalLineScroll: to set the proper amount to scroll when the user clicks the scroll arrows in the vertical scroll bar. You can get the scrollView by calling -enclosingScrollView on your tableView.