Comments (6)
I'm not sure how I'm supposed to detect that I have to handle that in code— the only way I know off the top of my head involves watching the view hierarchy, but that would mean checking for private classes (i.e. UITransitionView). I'd always assumed that this was something which was done for me by the navigation controller.
from aqgridview.
When I stepped through the code, I noticed that the contentOffset of the AQGridView was set to {0, -44} when in portrait mode with a translucent nav bar. I believe it's set to {0, -38} in landscape because the nav bar is shorter in landscape. There's two changes that fix this issue. One is in AQGridView, there are two places where instead of using CGPointEqualToPoint() to compare to CGPointZero, compare point.y <= 0.0f.
The second change has to do with the way the content size is calculated. I turned off contentSizeGrowsToFillBounds but it was still expanding the content size to the bounds, and it also wasn't taking into account the negative content offset. As I was stepping through the code I noticed that in AQGridViewData, in sizeForEntireGrid, it sets the height of the grid to the height of the bounds, without checking if the flag that I set to no. So deleted the two lines with if statement that sets height = _gridView.bounds.size.height.
In -[AQGridView setContentSze:] it looks like it should take into account a negative content offset when calculating the size to fill the bounds.
I'm not sure if I should make a fork with the changes or if it'll be easier if you make them yourself.
from aqgridview.
Thanks Lucius.
Feel free to make a fork and update the code; it looks like it might be a couple more days before I can get back onto it myself.
from aqgridview.
I found a lot more bugs with using it with a black translucent nav bar, related to the assumption that the contentOffset would be non-negative. I don't have time now to go through and fix it so I don't have a fork.
from aqgridview.
I don’t think we must support an initial negative content offset, although the code not working correctly under this case is a bug; here are a few solutions that will probably work:
- Wrap the entire grid view in another view, with a 44-pixel space between the grid view’s top margin and the enclosing view’s top margin
- Increase the top content inset of the grid view (it’s a scroll view after all).
Good things about the second solution: a) I like it; b) I use it a lot; and c) when you tell the grid view to scroll to CGPointZero, it scrolls to the correct position, and inertial scrolling will bounce the entire view back to the correct position too.
from aqgridview.
Closing as Workaround Provided. Feel free to re-open this issue :)
from aqgridview.
Related Issues (20)
- Blinking or flashing of cells on scrolling
- Problem Spring Board Example
- Extending Springboard Example
- asynchronous image loading problem HOT 2
- Orientation change in ExpanderDemo
- ExpansionViewDemo - numberOfItemsInGridView
- Getting EXC_BAD_ACCESS in using AQGridView with Xib HOT 2
- Getting zero Objects in visibleCells and visibleCellIndices HOT 8
- reloaddata does not wipe out older cells
- reloadData does not invalidate selection
- AQGridView.m : updateVisibleGridCellsNow:Line-1584 - Memory leak
- updateNewGridDataAndCreateMappingTables for 64 bit HOT 7
- Hit test not working for cells in a second column + possible fix
- didSelectItemAtIndex:(NSUInteger)index not working properly HOT 1
- Grid Items are removed at random and my App crashes HOT 1
- EXC_BAD_ACCESS After XCode Validate Project Settings HOT 2
- book.h file not found
- Semantic Errors on upgrade to XCode 8
- XCode 8 error - 'objc_unretainedObject' is unavailable: use a (__bridge id) cast instead HOT 6
- Compiling error in Xcode 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aqgridview.