I'd like to place a button at the top of a UITableView or UICollectionView, but only shown when swiped up beyond the first row. Usually you see scroll to refresh or a search bar there, but I'd like to put a button there for another functionality. How can I do this?
Put the button on your first row and the rest of the data after. Set an inset on the tableview so the first row is hidden until the user scrolls.
Related
I haave to implement 3 seperate forms, but they have headers which make the forms collapsible when clicked.
When searching online I saw the expanding rows for UITableView. Is it possible to add a custom form view in the expanded view of the tableView? Or do I try another approach with 3 hidden views that appear when each of the header sections are selected?
I always use UIStackView inside my cell. And when user click expand button, i unhide views and call tablewview.reloadData(). This is my approach
You can use 3 stack views. Each stack view will have a heading label and a tableview inside it. By default all the tableviews are hidden and heading label are not hidden. Add a tap gesture to heading labels. Whenever user taps a heading label you can unhide the respective tableview. You can give tags to each heading label and tableview so you can identify which heading label is tapped, like if a user tapped heading label with tag 1, you will unhide the tableview with tag 1.
I'm trying to make a fullscreen tableView but also have some space at the top when the viewcontroller first appears for a searchbar which disappears when you scroll the tableView, right now I'm hacking it by making an invisible cell at top, however is there a way for it to do so that only when you first load the viewcontroller, the first cell is about one row lower but can still scroll up to reach the full height of the viewcontroller, so the top of viewcontroller when you scroll back to top?
This is what I have right now:
The issue I'm having right now is that the invisible cell creates a huge empty space when u scroll down, see below:
As I understand you don't want the search bar to stick at the top of your view, so it must be in one of the tableView Cells, if this is true if you want to have an empty space under the search bar you can have another custom cell which you can customize its height in tableView(_:heightForRowAt) function.
So each row has the same button and I want that button to scroll to the next row.
In tableView, you can set each button has different tags(button.tag). When you selected it, use tag to decide which row you will scroll to.
i have two views in a UIScollView. the first view is a normal view and the second view is a tableview.
i want enable swipe to delete a row in the tableview just when someone swipe from right to left. if someone swipe from left to right you will see the first view.
swipe to delete a row is just possible when the scrollenabled of the UIScollView is NO.
I have no idea when set the scrollenable no or yes.
is this even possible?
I want to do something similar to the left UITableView on imdb app on ipad.
Once you have selected an item, it will become the first item on the top and it will dock there. When you flick the list below, it will always be there.
Anyone has any suggestion on how I can achieve that?
That's not part of that UITableView.
It is a seperate UITableView with a custom UITableViewCell that is actually the same as in the UITableView with all the information about the selected film or character ...
When no film is selected, that second UITableView isn't visible. But as soon as you select an item, that UITableView at the top will become visible with the information about the selected item. That means that you will have to reduce the height of the UITableView (with the detail info about that item) so that the UITableView at the top will get some space for being displayed. Everytime you change the item, you need to update the UITableView using the general delegation and datasource methods for a table view. Once there's nothing selected, you just set the upper table view to hidden, and set the other table view's height to the full height.
That's all.