collectionview

Making a textView in a collectionView cell the firstResponder while navigating cells

ⅰ亾dé卋堺 提交于 2019-12-11 17:32:23
问题 I have a collectionView and allow a user to dynamically add cells to the collectionView. The view controller only shows one cell at a time and I want the first textView (which is part of the cell) to become the firstResponder (and keep the keyboard visible at all times), which works fine when loading the view controller (as well as in one of the cases below). I have created a method to detect the current cell, which I call every time in any of these cases: (1) user scrolls from one cell to

retain scroll position for nested collectionView

谁说我不能喝 提交于 2019-12-11 15:57:17
问题 After the tableView.reloadData() the visible collectionView display the first row unexpected immediately. Im building a tableView contains collectionView in its cells, users can scroll multiple images in every single tableView just like Instagram. How can I fix it? Thanks! tableView DataSource func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return photoRolls.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) ->

Click CollectionViewCell displays the previously selected cell instead of the current one

戏子无情 提交于 2019-12-11 12:36:51
问题 I have one problem, when I click on a cell, nothing happens, and when I click on a second cell that displays the data of the previous cell (or the one I clicked on first) in resumé I think it shows me the wrong index.item (in the detail view) #define API_V3_CHANNEL_URL @"examples.json" @interface MSContestListViewController () @end @implementation MSContestListViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. CGRect frame = CGRectMake

How to correctly handle the CollectionChanged event of datagrid?

扶醉桌前 提交于 2019-12-11 10:38:34
问题 I initially asked a question related to dataGrid insert/delete/save operations with Entity Framework here However I was not able to totally get the suggested approach to work. Here's my approach so far: ViewModel constructor public DeviceDatabaseViewModel() { LoadData(); } LoadData private void LoadData() { _context.Devices.Load(); _devices = _context.Devices.GetLocal(); _devices.CollectionChanged += Device_CollectionChanged; DeviceCollectionView = (CollectionView)new CollectionViewSource {

Cells are hidden using CollectionView

纵饮孤独 提交于 2019-12-10 23:53:36
问题 I have a Navigation Controller pushing to a Collection View Controller. This collectionView has an NSArray of images, and I'm sure there are some elements in the collectionView using the method visibleCells. But when I launch it there is no displaying cells. Here is my code : - (void)viewDidLoad { [super viewDidLoad]; images = [NSArray arrayWithObjects:@"angry_birds_cake.jpg", @"creme_brelee.jpg", @"egg_benedict.jpg", @"full_breakfast.jpg", @"green_tea.jpg", @"ham_and_cheese_panini.jpg", @

How to initialize popover view from UICollectionViewCell in IOS

最后都变了- 提交于 2019-12-10 15:44:26
问题 I've been tracking along with an iPad app using storyboards, and I've been stuck on this for days. How can I initiate a popover segue by selecting a cell in a collection view? The main problem is getting past the error that the popover must be anchored to a view. The approach seems to be putting a dummy popoverAnchorButton (hidden, disabled) in the view, create a segue from it to the popover view in the storyboard, position it in didSelectItemAtIndexPath , and then [self performSegue] . Code

Filtered CollectionView Gives Wrong Count

你离开我真会死。 提交于 2019-12-10 02:06:16
问题 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

Swift prepare for segue - Send data from one view controller to another

落花浮王杯 提交于 2019-12-08 10:08:49
问题 I want to move from one view controller to another and send userId: func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { self.performSegueWithIdentifier("chosenPerson", sender: self) } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "chosenPerson" { let chosenPerson = segue.destinationViewController as? chosenPersonViewController let indexPaths = self.collectionView!

UITableView in UICollectionView

橙三吉。 提交于 2019-12-08 07:22:14
问题 I placed a tableView inside a collectionView and added the delegates. The problem is, that I want to control the data in the different tableViews in the collectionView . Every collectionView holds a label with the name of the current day (e.g.: "Monday"). Below the label is a tableView . In the tableView should be displayed different data, based on the index of the collectionView . In my example, every tableView has two cells. The tableView in the first item of the collectionView should

cellForItemAt is not calling in collectionView

丶灬走出姿态 提交于 2019-12-08 04:50:37
问题 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