Comments (9)
Yeah, it's an artifact of how it handles indexing— it counts along each row. For horizontal scrolling I'm not entirely certain what the ideal format would be. Keeping the same thing might not be the best thing, and it would definitely require a change to the way I'm tracking which items are visible (I wouldn't be able to use a range any more, I'd have to use an NSIndexSet).
In Kobo we're only using this mode with a single row (in the 'I'm Reading' expose-style overlay), so we don't hit this problem. The ImageDemo I modified here to show off horizontal scrolling does though, which is somewhat annoying. I've just not gotten around to making a decision yet how it ought to be done, or whether there should be a developer setting for it.
from aqgridview.
Hey, I'd really like to see the horizontal scrolling work. Is this something that you're going to be putting time into?
I might be able to help implement it, but I think I would need to understand the code base a little deeper. I implemented a general solution to this problem that looked somewhat different (arbitrary rects and visibility testing, different layout manager for vert / horiz), but unfortunately it's owned by eBay :(
from aqgridview.
I am also trying to implement horizontal scrolling in SINGLE row. But when I run application gives me Vertical scrolling as well, which I don't need. I only required horizontal scrolling in the gridview. Horizontal scrolling working fine, I just need to fix vertical scrolling.
Here is my UI setup and code,
- MyCustom view in which I place AQGridView. My Custom view height is 110px as well AQGridView height is 110px.
- For AQGridViewCell, I took some different approach (since I more in favour of IB). So I created a view 110x110 (width x height) and add it in gridview's as subview in contentview:
//In MyCustomView.m
-(void)awakeFromNib {
//self.gridView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
self.gridView.autoresizesSubviews = NO; //Also tried with YES
self.gridView.delegate = self;
self.gridView.dataSource = self;
self.gridView.layoutDirection = AQGridViewLayoutDirectionHorizontal;
self.gridView.separatorStyle = AQGridViewCellSeparatorStyleEmptySpace;
self.gridView.resizesCellWidthToFit = NO;
self.gridView.separatorColor = nil;
}
-
(AQGridViewCell_)gridView:(AQGridView_)aGridView cellForItemAtIndex:(NSUInteger)index {
AQGridViewCell * cell = [aGridView dequeueReusableCellWithIdentifier:[GridItemView gridItemViewIdentifier]];
if(cell == nil) {
cell = [[[AQGridViewCell alloc] initWithFrame: CGRectMake(0.0, 0.0, 110.0, 110.0)
reuseIdentifier:[GridItemView gridItemViewIdentifier]] autorelease];
[cell.contentView addSubview:[GridItemView createGridItemview]];cell.contentView.backgroundColor = [UIColor clearColor]; cell.backgroundColor = [UIColor clearColor]; cell.contentView.opaque = NO; cell.opaque = NO; cell.selectionGlowColor = [UIColor blueColor];
}
//....
return cell;
} -
(CGSize)portraitGridCellSizeForGridView:(AQGridView*)aGridView {
return CGSizeMake(110.0, 110.0);
}
//In GridItemView.m
+(id)createGridItemview {
return [[[NSBundle mainBundle] loadNibNamed:@"GridItemView" owner:self options:nil] lastObject];
}
from aqgridview.
I think I found the issue.
Issue is in the (void) setContentSize: (CGSize) newSize function. There is a line
newSize.height = fmax(newSize.height, self.frame.size.height+1); which is creating issue so I changed it with following code. Please let me know, you see any issue in the updated code.
if(self.layoutDirection == AQGridViewLayoutDirectionHorizontal)
newSize.height = fmax(newSize.height, self.frame.size.height);
else
newSize.height = fmax(newSize.height, self.frame.size.height+1);
It fixes the vertical scrolling issue in Single Row Horizontal gridview.
from aqgridview.
What's the status of this issue? Using a range to define visible cells won't work in multi-row horizontal scrolling, NSIndexPath sounds better. Is someone working on this (I am not expert enough to fix it myself)?
from aqgridview.
Found a branch with a partial fix. They moved to an index set.
https://github.com/marcammann/AQGridView/
So far it seems to work.
I am working on the other part, which is to re-layout the indexes into the logical pages. That is to say page 0 should contain indexes 0-19, page 1 20-29, etc…
from aqgridview.
Any word on how this is coming? I'd like to use this library for a single row, paged scrolling grid view. It sounds like this would be needed.
from aqgridview.
I think I also see that error.
"*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: range.location + range.length <= [_visibleCells count]'"
I created a grid on the iPad and I always see it when I rotate it several times.
Any suggestion or idea about how to fix this?
This is a nice lib and works ok for me except that detail.
from aqgridview.
My AQGridView Horizontal scrolling is not working
and get the following error...
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* setObjectForKey: key cannot be nil'
*** First throw call stack:
(
0 CoreFoundation 0x0048c5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0382a8b6 objc_exception_throw + 44
2 CoreFoundation 0x00516578 -[__NSDictionaryM setObject:forKey:] + 888
.
.
.
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.