gnosishub / ghcontextmenu Goto Github PK
View Code? Open in Web Editor NEWPinterest like context menu control for iOS
License: MIT License
Pinterest like context menu control for iOS
License: MIT License
The context menu is not rendered properly when we change the device (iPad/iPhone) orientation. It always renders the context menu considering the orientation as normal Portrait in all the orientations due to which the context menu is wrongly rendered. It works fine in Portrait orientation but fails to give the same experience in other orientations. We would appreciate if you provide orientation support and help us by fixing this issue on priority. Thank you!
i tried to change it to a single touch not long press touch to show the menu , but its not working !
can you help me with this ?
#20 make it more like Pinterest
how can I change this colour?
Hi,
I have a feature request based on what I'm trying to change in the context menu at the moment. If you imagine that one context menu option is to favourite an item, then long pressing on a collection view item should bring up a favourite icon if its not in your favourites or else bring up an icon for removing the favourite if it is already one. At present, the control is built up only on initialisation so can't be changed in this way.
I've looked at adding in a call to reloadData and animateMenu in the long press gesture handler but this doesn't seem to work in terms of regenerating the menu and I'm not really clear why not.
Also if you gave me a pointer in the right direction I could try to complete it myself.
Many thanks,
Rob
How would I add blur effect instead of just background color as the background of the menu? I tried several approaches but my code for filter just gets ignored. The issue is that inside GHContextMenuView I don't have self.view to add the subview.
Quick fix in layout menu items:
(void) layoutMenuItems
{
[self.itemLocations removeAllObjects];
CGSize itemSize = CGSizeMake(GHMenuItemSize, GHMenuItemSize);
CGFloat itemRadius = sqrt(pow(itemSize.width, 2) + pow(itemSize.height, 2)) / 2;
self.arcAngle = ((itemRadius * self.menuItems.count) / self.radius) * 1.5;
NSUInteger count = self.menuItems.count;
BOOL isFullCircle = (self.arcAngle == M_PI*2);
NSUInteger divisor = (isFullCircle) ? count : count - 1;
if (divisor == 0) divisor++; // bump divisor up to 1 if it is zero...
In the UICollectionView example, simply tap and hold in the gutter between cells (or add return NO; to the first line of shouldShowMenuAtPoint).
See the partial g+ button in the screenshot.
I have a hack-ish workaround:
if (self.dataSource != nil && [self.dataSource respondsToSelector:@selector(shouldShowMenuAtPoint:)] && ![self.dataSource shouldShowMenuAtPoint:pointInView]){
[self removeFromSuperview]; //rip self back out of view hierarchy, seems to correct.
return;
}
Would you like a pull on this, or do you have a better idea of what is going wrong and how to fix it?
Good stuff otherwise!
--DT
It would be great if we could use views instead of images.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.