tableviewcell

Table view cells showing actual data only after scrolling once

混江龙づ霸主 提交于 2019-12-24 01:48:11
问题 NSArray *sectionArray; int sectionCount=0; NSDictionary *orderedData; NSString *checkInStr, *checkOutStr; NSString *govtTaxes, *enhancementTotal, *grandTotal; - (void)viewDidLoad { [super viewDidLoad]; [self setupTable]; [self.bookingsTableView reloadData]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } -(void)viewDidDisappear:(BOOL)animated { if(doesSendNotification){ NSLog(@"summary view disappeared"); [[NSNotificationCenter defaultCenter] postNotificationName:@

Set tableview cell row height dynamically?

随声附和 提交于 2019-12-24 00:52:06
问题 I have a tableview with a label and an image. in some cells, there is no image as i used imageView.removeFromSuperview() to remove it from the cell. When there is an image in the cell, the row height is 445 and "Custom" is checked off. how can i set the row height dynamically according to how long the label is instead of how long/big the imageview is after i remove the imageview? 回答1: If you want dynamic row height, you can define your constraints (making sure they're unambiguous), set the

Add a UITableView to an existing ViewController

ε祈祈猫儿з 提交于 2019-12-23 16:32:27
问题 I'm trying to add a UITableView to an existing UIViewController programmatically. My run.h file has this: @interface runTests : UIViewController <UINavigationControllerDelegate,UITextFieldDelegate,UIAlertViewDelegate,UITableViewDelegate,UITableViewDataSource> {NSTimer *Timer;} @property (strong, nonatomic) UITableView *tableView; My app runs through a speed test and at the end of the test I'm trying to add a TableView to the View. At the moment I have this: -(void)addSpeedTable { self

Table view's `cellForRow(at:)` is `nil` in Unit Test

微笑、不失礼 提交于 2019-12-23 10:15:45
问题 In Unit Test, I have a simple table view with a bunch of basic cells (cells with just a label). I would like to access the cell using cellForRow(at:) , so I can test thing like selecting and deselecting the row programmatically, but this cellForRow query always returns nil . There is some discussion online that I should be using the data source's tableView(_, cellForRowAt:) instead. This is not my intention. I only want to test the cell's visibility, test selecting and deselecting them. To

Custom Table Cell Reuse / Dequeue

a 夏天 提交于 2019-12-23 04:41:13
问题 I know similar issues have been posted before but I can't find a solution for me within them so please bear with me... I have a tableview with a custom table cell in xcode. The cell is currently nothing more than a label: SiteFileCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; cell.fileNameLabel.text = [self.listDir.filesInfo objectAtIndex:indexPath.row]; This works great. I am essentially doing a directory drill down structure. When I select

filterTableViewController.reloadRows reloading rows only on first call

筅森魡賤 提交于 2019-12-23 02:38:38
问题 I have a table with 3 rows each with check button.What I am doing is when I select all the three buttons I want to click my cancel button which is on view not table on same controller to reload all 3 rows the call goes to custom cell class where uncheck is set to true and rows are reloaded.For the first attempt it works fine I can see correct index to be reloaded.On the second time again when I select all 3 check buttons and click cancel again I can see correct index to be reloaded but the

Embed Collection View in Custom Table View Cell

徘徊边缘 提交于 2019-12-22 05:23:24
问题 I have a table view with a custom Cell which gets it contents from an array, this all builds fine. I want to add to this content a Collection View of thumb nail images of varying number to each of the custom Table View Cells. I have added the Collection to the Custom Cell in the Story Board. I have linked the Collection to the Custom Cell.m (not sure it should go there). I have created a Collection Custom Cell and linked the image in. It is from here I am not sure, should the methods for

Show custom label when no data available for tableView

◇◆丶佛笑我妖孽 提交于 2019-12-21 04:18:14
问题 The app in question has an ability for users to mark items as favourite. When the user has no favourites saved, I'd like to notify them of the fact (mostly I hate the idea of a blank tableView). My numberOfRowsInSection is zero when there are no items the user has marked as favourite. I'd like to set cell.textLabel.text = @"You have no favourites" but when there are no items for the table cellForRowAtIndexPath is not called. I could test numberOfRowsInSection to give a result when it

dequeueReusableCellWithIdentifier always return non nil?

时光总嘲笑我的痴心妄想 提交于 2019-12-19 04:07:34
问题 In the classic pattern below the returned cell from dequeueReusableCellWithIdentifier is always non nil . Why? Shouldn't we have to allocated some cell first then we can have some to be reused? I am using a customize cell and it was created in the storyboard. (However, if I had used the default UITableViewCell ,the phenomena is same - the returned cell is still always non-nil ). Enviroment: Xcode 4.3.3 iOs 5.1 AlbumListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AlbumCell"]; /

Unable to make view equal width to cell in iOS?

大城市里の小女人 提交于 2019-12-18 07:04:09
问题 I am making a custom cell in iOS.I have added prototype cell.I m trying to add a view inside a cell of equal width to parent cell.But the width of cell is not equal please tell me how should i do it? Constraints are: View structure: EDIT: In preview on iPad it does not show complete view .But on actual device it works fine.Why? sample here https://drive.google.com/file/d/0B7RGQm8-8k24Q0tXUFZOLUZFQk0/view?usp=sharing 回答1: As I checked your sample project I found that You made your