TableView issue (weird Visualization) - ios

I have a class (movieTable.m) with TableView populated with many cells.
As i Clicked one of them, the navigation controller brings in the other scene done in the StoryBoard.
When i get back, still with Navigation Controller, i find the TableView moved little bit down.
As I debugged the Hierarcy i found that UITableViewWrapperView is scrolled down from UITableView.
Edit: The funny thing is: if i put a UiSegmentedControl in the UiView the issue disappears.
Why this? i didn't tell the code to move it. Maybe I'm getting wrong with the timing?
so to making clear the ideas, there's two images:
Hierarchy before/after changing the scene
The Code if you want to see it is in this following GitHub: GitHub
Thank you all for helping&hints.

this worked for me
add
self.automaticallyAdjustsScrollViewInsets = NO;
to your viewDidLoad of the moveiTable.m

Related

UISearchController's UISearchBar shifts incorrectly and jumps when UITableView is scrolled

In the video, it's a little difficult to see what's going on, so I'll try to explain it.
https://youtu.be/yOrCJB9yZlg
I have UIViewController with UITableView inside its root view. Binded via Autolayout (there is no difference how it's binded: to SuperView or to SafeArea).
SearchBar added like this:
let search = UISearchController(searchResultsController: nil)
self.navigationItem.searchController = search
When I slowly scroll table, the transition between large navbar and compact navbar, and then animation of showing in and out of searchBar is too fast. Searchbar jumping in/out of navbar instead of smoothly opened/closed; navbar transitioning is jumping between two states, large and compact, without smoothly passes through the middle half-opened state while you slowly moving your finger on screen, like in system apps (Mail, Phone, Messages, Contacts etc).
I made the example from an empty project to demonstrate the issue; there isn't any changes to navigation bar logic, or any logic at all. Just two new VC's and this odd behaviour.
If i create xCode's "Master-Details" project example and add UISearchController to it, it will work properly. I assume its because they used UITableViewController instead of UIViewController + UITableView inside.
What the reason of this behaviour and how to fix it?
I had the same problem with the search controller transition and tableview.
like this its flickering or tableview was jumping. The search controller was on the navigation item.
The key solution is to remove safe area guide from your view controller and assign top bottom left right constraints to your tableview. It will be smooth like this
What you have done is correct. Did you try running your code in a device? Feels more like a glitch in the simulator. I tried what you tried and it works fine for me in the device. Whereas the glitch occurs in simulator.
Refer to this article. They have explained step by step process.
This is a known problem and your code seems fine. This problem was already discussed here.
Problem appears when you're using UIScrollView or its subclasses with large navigation titles. It doesn't work. Problem disappears when you use UICollectionViewController or UITableViewController instead.

UITableview scrolling to top after popViewControllerAnimated is called

I am having an issue with an UITableView.
I am displaying a collection of tracking records. After the user taps on a cell, a detail view controller is displayed with detailed data. My problem is after I call popViewControllerAnimated:YES from the Detail view controller, my table view is reseted and scrolls to the top position automatically.
I am not calling [myTable reloadData]; on viewWillAppear and I find this behavior kinda strange.
Does anyone have an idea what I might be missing here?
Any help or tip would be appreciated!
Thanks,
Granit
It's a known issue.
The more the estimatedRowHeight differs from the actual height, the more the table will jump when the push segue happens. The easiest workaround is to use a much better estimate.
if you don't call reloadData then either you re-add the table somewhere or you popped ViewController was reloaded because of some reason. Does ViewDidLoad called when you pop back?
How about storing the table scrolling state? (contentOffset)

UInavigation popping back view and updating previous view's content

I have a collection view with cells that can be tapped, and push to a second view. The problem is, the changes I make in the second view are suppose to alter the first view(collection view) when the user pops back to it. By adding a new cell with an image.I can't seem to get the content to update.
I tried to use viewWillAppear on the first view and [colectionview reloadData] it doesn't seem to work. Anyone got a fix for this? help would be greatly appreciated.
Have you debugged either UIcollectionViewDataSource methods are being called? Make sure you have set the delegate and datasource off collection view. What is the data source of collection view? Please paste your code of second view where you are making changes.
I fixed the problem By calling [collectionview reloadData] in viewDidAppear instead of viewWillAppear, only problem is there is a noticeable amount of lag before the cell appears. Anyone know a better way?

Static TableViewCells Hidden Above Screen

I had three UIPickerViews in a Static TableView that was working well and decided to delete top most UIPickerView. Now the UIPickerView that at the top of the view is hidden. If I swipe my TableView down, I can see it but cannot select it.
I believe my TableViewController is set up correctly but may be missing something. I tried deleting the TableViewController completely in StoryBoard but this did not correct it.
Has anyone encountered a problem like this? I can post code if necessary.
Thanks!

uitableview not reload again in half view like facebook Half view

I have made an application, in which I have used uitableview in Half view like facebook, when I go to half view using swipe, then uitableview does not reload, but it reloads when I run it first time,So if anyone knows about it, please tell me.
Thanks
I have subclassed JASidePanel and in that subclass I override a method as show below:
- (void)toggleLeftPanel:(id)sender
{
[((MyLeftPanelViewController *)self.leftPanel) myReloadMethodInMyLeftPanelViewController];
[super toggleLeftPanel:sender];
}
This works when using the left navigation button to navigate to the left panel, but I think a similar approach would work for swipe. I figured this out by looking in the header file for JASidePanel and then tracing the code.

Resources