uitableview

Deleting rows from a static UITableView at runtime

我怕爱的太早我们不能终老 提交于 2020-01-24 13:11:51
问题 Is it possible to delete rows from a UITableView at runtime when all of the sections and rows are defined statically in a nib? In the following storyboard scene, can I delete the "Addr 2" field at runtime? In this case I have not provided a data source to the UITableView . 回答1: I don't know about "delete" but you can hide the row using tableView:heightForRowAtIndexPath: . - (void)methodToToggleAddr2CellVisibility { self.addr2CellIsHidden = !self.addr2CellIsHidden; [self.tableView beginUpdates

Deleting rows from a static UITableView at runtime

跟風遠走 提交于 2020-01-24 13:11:12
问题 Is it possible to delete rows from a UITableView at runtime when all of the sections and rows are defined statically in a nib? In the following storyboard scene, can I delete the "Addr 2" field at runtime? In this case I have not provided a data source to the UITableView . 回答1: I don't know about "delete" but you can hide the row using tableView:heightForRowAtIndexPath: . - (void)methodToToggleAddr2CellVisibility { self.addr2CellIsHidden = !self.addr2CellIsHidden; [self.tableView beginUpdates

Increase height of tableview cell according to amount of UILabel text

限于喜欢 提交于 2020-01-24 12:34:32
问题 I want to change the height of my tableview cell according to the amount of text by using auto layout. I have tried the following code but it doesn't work: - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { AddTaskDetails *addTaskDetail = (self.tasksArray)[indexPath.row]; CGFloat height; float textcount = [addTaskDetail.taskDetail length]; if(textcount>60) { height = textcount-20; NSLog(@"%d,%f",indexPath.row,height); } else { height = 70; }

Increase height of tableview cell according to amount of UILabel text

狂风中的少年 提交于 2020-01-24 12:32:48
问题 I want to change the height of my tableview cell according to the amount of text by using auto layout. I have tried the following code but it doesn't work: - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { AddTaskDetails *addTaskDetail = (self.tasksArray)[indexPath.row]; CGFloat height; float textcount = [addTaskDetail.taskDetail length]; if(textcount>60) { height = textcount-20; NSLog(@"%d,%f",indexPath.row,height); } else { height = 70; }

Nested UITableView dynamic height

ぐ巨炮叔叔 提交于 2020-01-24 10:36:28
问题 I need to have a nested UITableView in a tableView cell (actually, two tables in one cell) to show different lists with dynamic content (so, I need dynamic heights). My nested tables will not have scrolling—I need them just to order elements of different kinds, like texts, pictures, fields etc. To be more clear—the first level is the level of operations and every operation can have a variable amount of instructions and actions. Instructions and actions should be placed side by side and the

Efficient way to update table section headers using Core Data entities?

天大地大妈咪最大 提交于 2020-01-24 09:44:05
问题 Im using a NSFetchedResultsController for my UITableView which displays a bunch of events im storing in core data. What i am trying to do is group the table by relative date (ie Today, Tomorrow, This Week, etc..). Each event has a start date and i tried creating a transient property in the event entity called sectionIdentifier which converts the date into a relative date as mentioned above like so: - (NSString*)sectionIdentifier { [self willAccessValueForKey:@"sectionIdentifier"]; NSString

Determine if image in table view cell is completely visible

不羁岁月 提交于 2020-01-24 09:39:07
问题 I have a table view where each table view cell has an image. I need to determine when an image view is completely visible on scroll. Additionally, if two images in two separate table view cells are completely visible at the same time, I want to only trigger an action for the first image. I've thought of using willDisplay, but I've found that this only ever triggers once and it triggers as soon as the cell comes into view. I also found this question, but it's specific to determining if the

NSAttributedString freeze UITableView

坚强是说给别人听的谎言 提交于 2020-01-24 08:00:51
问题 Application really freeze while scrolling with NSAttributedString (When I use NSString it works fine), so there my method: - (void)setSubtitleForCell:(TTTableViewCell *)cell item:(TTPhotoPost *)item { NSAttributedString *attributedString = [[NSAttributedString alloc] initWithData: [item.caption dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil]; [cell.descriptionLabel setAttributedText

NSAttributedString freeze UITableView

只愿长相守 提交于 2020-01-24 08:00:09
问题 Application really freeze while scrolling with NSAttributedString (When I use NSString it works fine), so there my method: - (void)setSubtitleForCell:(TTTableViewCell *)cell item:(TTPhotoPost *)item { NSAttributedString *attributedString = [[NSAttributedString alloc] initWithData: [item.caption dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil]; [cell.descriptionLabel setAttributedText

Swift: Expand UITableViewCell height depending on the size of the UICollectionView inside it

╄→尐↘猪︶ㄣ 提交于 2020-01-24 04:22:10
问题 Hi everyone. I started learning programming 1 month ago so please be nice if I don't explain my problem well :) My project is composed of a main UITableView . In each cell of the UITableView , I have a UICollectionView (on horizontal scrolling). Img 1 : Main view The width of each UICollectionViewCell is the same as the entire UITableViewCell . My first problem is about sizing the height of the UITableViewCell (which will depend of the size of the UICollectionView itself and the size of the