uitableview

Custom UITableViewCell register class in Swift

孤街浪徒 提交于 2020-01-10 01:02:50
问题 In my application, I fill the table on the basis of the array. The table uses custom UITableViewCell. Everything works fine, table is filled. Then I add Search Display Controller to my UITableViewController, no write code to handle the search, simply add the controller. When you run the application, the table is still filled.But if I try to click on the search bar, I get the error: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell

UITableViewCell,在滑动时显示删除按钮

妖精的绣舞 提交于 2020-01-09 22:15:53
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 如何在 UITableViewCell 上滑动时显示删除按钮? 永远不会引发该事件,并且永远不会出现删除按钮。 #1楼 注意:我没有足够的声誉在Kurbz的答案中发表评论。 Kurbz的答案是对的。 但对我来说它从来没有奏效。 经过一些调查,我意识到 在不编辑表格视图时会发生滑动到删除。 。 我从未见过如此明确说明。 除非我弄错了,否则我没有找到任何其他办法让它发挥作用。 编辑时,将显示删除和/或重新排序控件。 #2楼 删除tableview的单元格时,还必须删除索引x处的数组对象。 我认为您可以使用滑动手势将其删除。 表视图将调用Delegate: - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { //add code here for when you hit delete [dataSourceArray removeObjectAtIndex

Custom UITableViewCell and IBAction

倖福魔咒の 提交于 2020-01-09 19:38:10
问题 I have a custom UITableViewCell on which I have added a button, I have associated that button on an IBAction in my viewController. Now the problem that i am facing is how do I know from which cell that button was created. When I present my viewController which has a table in it and has multiple rows (custom UITableViewCell), now when the user presses the button the action is getting called, but how do I know which row was it. Because based on the row index I need to store some value. Edit: I

Changing the delete accessory view in a UITableViewCell

为君一笑 提交于 2020-01-09 18:38:28
问题 Is it possible to change the view shown in response to a left to right "I want to delete this row" swipe in a UITableView's UITableViewCell? Currently the 'delete' button seems to ignore all of the other UITableViewCell customisation options. 回答1: The tricky thing about deleting cells is this: when you swipe left to right to show the "delete" button, the UITableViewCell moves to the UITableViewCellStateShowingDeleteConfirmationMask state, but doesn't set its UITableViewCellStateEditingMask

Changing the delete accessory view in a UITableViewCell

…衆ロ難τιáo~ 提交于 2020-01-09 18:35:52
问题 Is it possible to change the view shown in response to a left to right "I want to delete this row" swipe in a UITableView's UITableViewCell? Currently the 'delete' button seems to ignore all of the other UITableViewCell customisation options. 回答1: The tricky thing about deleting cells is this: when you swipe left to right to show the "delete" button, the UITableViewCell moves to the UITableViewCellStateShowingDeleteConfirmationMask state, but doesn't set its UITableViewCellStateEditingMask

Changing the delete accessory view in a UITableViewCell

放肆的年华 提交于 2020-01-09 18:34:09
问题 Is it possible to change the view shown in response to a left to right "I want to delete this row" swipe in a UITableView's UITableViewCell? Currently the 'delete' button seems to ignore all of the other UITableViewCell customisation options. 回答1: The tricky thing about deleting cells is this: when you swipe left to right to show the "delete" button, the UITableViewCell moves to the UITableViewCellStateShowingDeleteConfirmationMask state, but doesn't set its UITableViewCellStateEditingMask

How to implement UIVisualEffectView in UITableView with adaptive segues

老子叫甜甜 提交于 2020-01-09 12:26:08
问题 I would like to implement UIVisualEffectView to apply a blur effect to a view to show the view that lies behind it. This view that should have its background blurred is a UITableViewController that is embedded in a UINavigationController , and it will either be presented in a popover on iPad or it will be presented full screen modally on iPhone, thanks to iOS 8 adaptive segues (Present as Popover). When this view controller is in a popover I want the background to blur what's underneath the

UITableViewCell initWithStyle:UITableViewCellStyleSubtitle is not working

99封情书 提交于 2020-01-09 10:55:36
问题 I'm having an issue in trying to display info in a cell, one on the left and one on the right. I'm aware using initWithStyle with UITableViewCellStyleSubtitle . I use this but it doesn't seem to work. Here is some sample code: - (UITableViewCell *)tableView:(UITableView *)ltableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Account Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [

UITableViewCell initWithStyle:UITableViewCellStyleSubtitle is not working

浪尽此生 提交于 2020-01-09 10:54:07
问题 I'm having an issue in trying to display info in a cell, one on the left and one on the right. I'm aware using initWithStyle with UITableViewCellStyleSubtitle . I use this but it doesn't seem to work. Here is some sample code: - (UITableViewCell *)tableView:(UITableView *)ltableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Account Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [

Custom UITableViewCell Not Using .xib (Most Likely Because of Flaw in init Method)

喜欢而已 提交于 2020-01-09 10:32:28
问题 I subclassed the UITableViewCell in order to customize it, but I think I'm missing something because: 1) It's not working and 2) There are a couple of things I'm confused on. Along with customizing the look of the .xib file, I also changed the backgroundView, and that part is working fine. The part that I least understand/am most confused about is the init method, so I posted that here. If it turns out that is correct, please tell me so I can post more code that may be the cause. This is the