Still new to iOS programming here. Have a UITableView that works perfect on iOS 7 but appears crushed in iOS 8. Multiple devices. Also exhibits the same problem/difference when using the simulators (iOS 7 vs. iOS 8 simulators).
I am on Xcode 6 beta 6, Yosemite beta 6, iOS 7.12 and iOS 8 beta 5.
I've made the code as simple and complete as possible to show the problem:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
return [self.numberOfDays count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier ];
NSLog (@"%li", (long)indexPath.row);
UILabel *label;
label = (UILabel *)[cell viewWithTag:1];
label.text = @"Monday";
return cell;
}
Notice my NSLog statement. There are 88 rows in my UIViewTable (0-87).
When this table loads in iOS 7...
When this table loads in iOS 8...
The initial appearance of the table looks OK (e.g. the first 12 rows display correctly) until I attempt to scroll thru it. Then rows 12-87 appear about 1 pixel tall.
PLEASE HELP!
OK - it was as simple as adding: tableView.rowHeight = 44; after my static NSString *CellIdentifier = @"Cell"; line. I didn't need this is iOS 7, not sure why I need it in iOS 8.
OK - it was as simple as adding:
tableView.rowHeight = 44;
after my
static NSString *CellIdentifier = @"Cell";
line. I didn't need this is iOS 7, not sure why I need it in iOS 8.