collectionview

iOS换一种思路写一个无限轮播的滚动视图

别等时光非礼了梦想. 提交于 2019-12-07 08:46:04
不循环设置元数据,只用3个cell,连续滚动一辈子滚不到头??? 哈哈哈,不开玩笑,你值得拥有 写这篇博客已经距离我当时写轮子差不多有一个月时间了,也完善了很多,基本是没有bug的,如果有,不妨留言,喜欢的话,劳烦各位点个赞,不喜欢的,不妨看看思路,提提意见 ## github地址 ## 码云地址 ###1. 以前的思路使用scrollView 基本是以下的方法 a,使用scrollView放轮播图,scroll分页放置图片可以实现左右轮播 b,在头尾各添加两个图片,然后在滑动到最后一张的时候处理滑动 例如123一共3张图片 加两个形成31231一共5张图片 c,当滑动到最后一张时候如何再往右滑动,瞬间无动画切换到起始位置的呢一张图,第一张往左滑动也同样处理 d,处理手动和定时器 scroll实现轮播图链接 ###2.最近流行的使用collection 使用collectionView可以很方便的创建轮播图,并且利用collectionViewCell的复用,很方便的管理,原理也很简单 a,把轮播图的元数据扩大,123123123...123123123 b,创建视图把初始位置设置为中间点 c,处理滚动到头时候 如此基本可以解决问题,如果害怕滑动到头一般设置为9999 这里一般会优化数据源, 使用123,在读取时候循环读取 ###3.自己的想法和优雅的点子 ####想法1

WPF DataGrid ignores SortDescription

流过昼夜 提交于 2019-12-06 21:59:51
问题 I've got a strange problem here regarding sorting of a WPF DataGrid (System.Windows.Controls.DataGrid in .NET 4.0). Its ItemsSource is bound to a property of the datacontext object: <DataGrid HeadersVisibility="Column" SelectedIndex="0" MinHeight="30" ItemsSource="{Binding FahrtenView}" AutoGenerateColumns="False" x:Name="fahrtenDG"> FahrtenView looks like this: public ICollectionView FahrtenView { get { var view = CollectionViewSource.GetDefaultView(_fahrten); view.SortDescriptions.Add(new

cellForItemAt is not calling in collectionView

只谈情不闲聊 提交于 2019-12-06 14:52:24
I have a inputView where a collectionView will be displayed. I used auto layout for that inputView. When running the app numberOfItemsInSection is called but cellForItemAt is not called. So no cell is displaying. Did I do anything wrong using constraint? I've also created project https://drive.google.com/file/d/0B5UHWsK1E6dSRDA5bmtSY2ZZbGs/view ViewController.swift override func viewDidLoad() { super.viewDidLoad() textField.inputView = InputPhotoView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 265)) textField.becomeFirstResponder() } InputPhotoView.swift class

How to get indexpath from row index Swift

十年热恋 提交于 2019-12-06 03:02:36
问题 I am loading an array to UIcollectionview (later will add other data) . I want to select collection view item randomly as: var indexpath = Int(arc4random_uniform(UInt32(items.count)-1) self.collectionview.selectitem(at: **indexpath**, animated:true ,scrollPosition:UICollectionViewScrollPosition) Here it’s giving me error at bold position saying: cannot convert value of type Int to expected argument type 'IndexPath? I can understand this exception as indexpath is different in swift from

WPF跨线程访问线程安全的数据

六眼飞鱼酱① 提交于 2019-12-05 15:07:54
wpf报错:(如解决:该类型的CollectionView不支持从调度程序线程以外的线程对其SourceCollection) 典型应用场景:WPF页面程序中,ListView的ItemsSource是一个ObservableCollection<StudentInfo>; 操作:另起一个线程,为ListView动态更新数据,也就是给ObservableCollection<StudentInfo>添加记录。这类操作,就是跨线程访问线程安全的数据,如果不使用Dispatcher,就会导致出错“该类型的CollectionView不支持从调度程序线程以外的线程对其SourceCollection”。 解决方案: Application.Current.Dispatcher.Invoke(new Action(()=> { User_Func(); })); 来源: oschina 链接: https://my.oschina.net/u/2332532/blog/1930251

prepareForSegue collectionView indexPath using swift

本小妞迷上赌 提交于 2019-12-05 06:31:21
问题 I don't find any good example to do what I want using swift so I allow myself to ask the question. Im using a collectionView to display PFObjects and I want to send the displayed cell data to a second controller using prepareForSegue. At this point, Im struggling to make this part of the code works: override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if(segue.identifier == "goto_answerquestion"){ var indexpath : NSIndexPath = self.collectionView

关于ComponentOne For WinForm 的全新控件 – DataFilter数据切片器(Beta)

我是研究僧i 提交于 2019-12-05 06:20:34
概述 数据切片器在电子商务网站上很常见 - 它们可以帮助用户快速过滤所选商品,并且所有过滤选项都可以在一个地方使用,通常包含核心控件类型为:清单,范围栏和单选按钮等。在ComponentOne For WinForm 最新版 2018V3 中,我们推出了数据过滤器的测试版,可以附加到任何数据感知控件中。 滤镜布局由手风琴面板组成,它为过滤条件提供了扩展/折叠选项: 以下就是ComponentOne For WinForm DataFilter控件的一些用法。 使用DataFilter过滤仪表板中的多个控件 仪表板是DataFilters的最佳实践,因为屏幕上的所有信息都可以在一个地方以交互方式进行过滤,从而使用户可以通过选择从数据中获取更多信息。 此外,每个视觉所触及之处都可以连接到DataFilter以进一步向下钻取。 当产品目录涉及大量有关产品的信息时,数据切片器将会派上用场: 将DataFilter控件集成到FlexGrid中 在处理Grid或TreeView等数据控件时,切片器可以是一个有用的交互式过滤工具。 当用户需要在多个列上进行过滤时,可以更轻松地将它们全部设置在一个位置: WinForm DataFilter的体系结构 DataFilter使用C1CollectionView进行过滤。 C1CollectionView 功能类似于 .NET

Filtered CollectionView Gives Wrong Count

青春壹個敷衍的年華 提交于 2019-12-05 02:55:51
According to the documentation , the Count of a filtered CollectionView should only be the count of items that pass the filter. Given this code: List<string> testList = new List<string>(); testList.Add("One"); testList.Add("Two"); testList.Add("Three"); testList.Add("1-One"); testList.Add("1-Two"); testList.Add("1-Three"); CollectionView testView = new CollectionView(testList); int testCount1 = testView.Count; testView.Filter = (i) => i.ToString().StartsWith("1-"); int testCount2 = testView.Count; I would therefore expect testCount1 to be 6, and testCount2 to be 3. However, both are 6. If I

How to create customized UICollectionView with 2 or more custom cells?

廉价感情. 提交于 2019-12-05 00:24:22
in my project I want to use UICollectionView with custom cells, I created collection view with custom cells but I want to use Different size of custom cell in my project I followed some tutorials but I din`t get it properly, and below I attached sample screen shot of what i really looking for collection view. One of the possible ways to create this is to use sizeForItemAtIndexPath and then return the size for your Cell . Here are some useful links on Github which are exactly doing what you want : RF Quilt Layout Mosaic Layout As in the First image, some cells have buttons whereas others don't

Scroll Multiple UICollectionView with one collectionview IOS

喜你入骨 提交于 2019-12-04 16:07:29
I am working on an application in which, I have UITableView and in each cell of uitableview i have uicollectionview scrolling horizontally. Now, What I want is that: When I scroll one collectionview in any direction then all other collectionviews of my table should scroll accordingly in that direction. I have tried using scrollview delegates but it is not working properly. I am stuck in this issue. I have looked on internet but could not found anything yet. Help needed! Thanks Ok I've checked my code, what I do was: I got a tableView on the left side of the screen, and on the rest a