I have tableView: UITableView object with a parallax header. Initially, the header height is 3/4 of the screen height.
If the tableView is scrolled to a little bit to top and tried to reloadRowsAtIndexPath, you will clearly notice a flickering happens.
The flickering occurs only on iOS +11.0 devices. However, if you assigned an arbitrary value to estimatedRowHeight that is too high, the tableView won't flicker, and vice-versa.
Since the UITableView had a lot of changes in iOS 11.0, I might be missing something.
I have initialized a repo with a sample project for the issue, you can test on iOS +9.0.
Example GIF:
Note: I have tried too many approaches for the parallax header, the issue always happens.
Related
In iOS 11 This is a pretty big change in behaviour of UITableview and existing code/or below iOS11 may work differently.
When i insert data in tableview row, row behaves weird like jumping or scrolling up and down.
I solved my issue:
In iOS 11, UITableView uses estimated heights by default. This is a big change in behaviour and existing code may work differently. Just put 0 to tableview property estimatedRowHeight.
yourTableView.estimatedRowHeight = 0.0
I'm using a long tableview. All of the cells are visible when I run the simulation but in the UIBuilder, only the top visible cells are showing. When I scroll further down through the table in UIBuilder, the cells are blank. This has only been an issue since I updated Xcode. Has anyone run into this issue before? I'm currently using Xcode version 7.1.1
This is a recent bug in interface builder. As a work around, change the size of the view controller in simulated metrics from inferred to freeform and increase the height until a cells render their content.
I'm using a custom UITableViewCell with an UIControl and a few UILabels in my UITableView and everything works fine only if the UITableView takes up the whole screen. I'm using a xib file for this.
The problem is that I need to resize the UITableView to take only the bottom half of the screen, and like this only the first row accepts touches. Also if I try to scroll by pushing up from lower cells it won't do it, but will only scroll if I hold the first row.
It happens on both iPad and iPhone, but it's particularly bad on the iPhone. It seems that only on the bottom half of the screen the scrolling doesn't work.
I've already checked all views, and there is none above the UITableView, I've checked all sizes, I've googled and searched on Stackoverflow, but I couldn't find anything similar to my problem.
What else do I need to be checking? Any thoughts on this?
The problem was that I had a custom Marquee UILabel, allocated and initialized via code and not via xib file, at the bottom of the screen and I was using the iPad frame instead of the iPhone one, so it was huge, being placed above the UITableView, consequently blocking it and preventing touch events.
As I was so focused on the xib file I totally forgot that I had setup this custom Marquee UILabel via code.
I thank Ethan Holshouser and Helium3 for all helpful comments above and the Reveal App suggested by Helium3 helped me greatly visualizing the views hierarchy to solve the problem.
I'm using a nav bar orchestrated set of tableviewcontrollers to display a hierarchy of data. The bottom level of data is displayed in a custom tableviewcell, which has its content described in a xib, and results in a required cell height larger than the default. I posted another question on how to programmatically extract the resulting cell height, but no usable answers, so I now implement heightForRowAtIndexpath to return a hardcoded value that is the height in the xib attributes panel. But, when the table is displayed with more rows than can fit in the normal display size (480h,320w), the bottom row is chopped off as expected, but I can't scroll it to see the rest of the row. I've searched rather extensively, but nothing has helped. I poked at various attributes (tableview sizes, scrollingEnabled, etc.) but they all seem as expected values (e.g., scrollingEnabled is true). One post suggested that no scrolling would occur unless the contentSize was larger then the frame, so I looked at those values, and it sounds promising, in that my frame size is a typical 460h x 320w, but, my contentSize is 0 x 0! Further searching (e.g., "setting contentSize" or "contentSize is 0") didn't clear anything up. I thought contentSize was computed for free from the table row count and their heights, so how could I be getting 0? Even going back to allowing a default row height by not implementing heightForRowAtIndexpath still resulted in a 0 contentSize. Some searches suggest turning off autoLayout for the custom table cell, but still the same. So, what might be going awry? Thanks for any thoughts or guidance.
Update: Sorry, I confess! I had originally been developing on a mac mini with a regular USB mouse, where scrolling in the simulator was left button down and drag. I recently switched to an iMac with the magic mouse. I'm now so used to just dragging my finger on the mouse to scroll code, web pages, etc., that I didn't think to try clicking and holding the left mouse "button", and then dragging the mouse. When I did, everything worked as expected. I had really thought things were hopeless when any similar variables/values in the app on the mini were equal to those on the iMac, but it was just me getting tricked by fancy technology. Sorry for the distraction.
set your tableView's frame and your cell's frame correct,and implement
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath in your UITableView to give a right height. If that doesn't work try set your tableView.autoresizingMask to UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
which can help you with the size of the tableview
I had a similar problem. My tableView would't scroll when the content exceeded the tableViews frame.
The problem for me was that I had "Use Autolayout" checked but no constrains on the tableView. Adding vertical and horizontal space constrains on the tableView fixed my problem
We have a UITableView that we have configured to act like a Grid, allowing both horizontal and vertical scrolling. We accomplish this by dynamically changing the ContentSize in a custom UITableView's LayoutSubviews method, which helps with autorotation, scrolling, etc.
Everything works as expected except on a couple of our larger grids. When these grids are scrolled horizontally (swipe left), as soon as the ContentOffset.X is greater than or equal to the Bounds.Width, the table view disappears. It is still present and receives input, but nothing is painted. On swiping back to the right, as soon as the width threshold is crossed, everything is repainted.
In situations where the size of the grid is less than half of the configured UITableView width, this issue does not occur. We cannot change the size of the grids because they are configured by customers in the field who expect the data to be available.
I have checked and/or removed as much of our custom drawing code as possible and the issue is still occurring. Does anyone have any ideas?
That is because although the UITableView inherits from the UIScrollView, it is only meant to have a single column, hence it draws its cells according to its Bounds.
If you want to create a grid-like control with the UITableView, I suggest using multiple table views in a parent UIScrollView side-byside and change that one's ContentSize.
I came across this same issue and posted a bug report (10561166) back in December on the Apple Developer site.
I received a response today from Apple in which they stated that
UITableView is not designed or intended for horizontal scrolling.
(I had since changed my design not to require the horizontal scrolling.)