mengxianliang / xlcardswitch Goto Github PK
View Code? Open in Web Editor NEWiOS 利用余弦函数特性实现可以居中放大的图片浏览工具
iOS 利用余弦函数特性实现可以居中放大的图片浏览工具
下载网速好慢
设置只有两个item,设置自动居中,然后来回滑动第一第二个item,-(void)cardSwitchDidScrollToIndex:(NSInteger)index;这个代理经常不调用
现在的是滑到最后一张就滑不动了 能添加一下无限滚动吗?
就是公司需要类似的效果,但是还有一个多的要求,就是一进页面,会指定某个图片在中间这样显示,是否是使用类似于与collectionview scrollToItemAtIndexPath:<#(nonnull NSIndexPath *)#> atScrollPosition:<#(UICollectionViewScrollPosition)#> animated:<#(BOOL)#>方法,或者selectItemAtIndexPath:<#(nullable NSIndexPath *)#> animated:<#(BOOL)#> scrollPosition:<#(UICollectionViewScrollPosition)#>
attributes.transform = CGAffineTransformMakeScale(1.0, scale);只实现了高度的缩放,所以闪动情况不明显。
当把attributes.transform改成attributes.transform = CGAffineTransformMakeScale(scale, scale);的时候,宽度也进行了缩放,闪动情况就更加明显了。
我研究了下,是因为cell重用的机制,导致从缓冲区里拿出来的cell,原先切换时设置的transform被还原了,但是找不到解决方案
博主你好,最近这需要实现这样的一个效果,但是要自定义每个item的大小,collectionView的宽度为屏幕宽度,item大小60*60,你的这个应该怎样定制呢
//手指拖动开始
(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
_dragStartX = scrollView.contentOffset.x;
}
//手指拖动停止
被这两个方法拦截了点击事件
如题
能否支持网络图片?
删除的时候 触发layoutAttributesForElementsInRect 导致左右两边的卡片晃动的感觉
It's so great!
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.