I try a method that creates a label and puts it on the screen but it doesn't allow me.
I am trying to create cells with dynamic height, with a single label I have no problem, however when placing two or more labels inside my cell it cuts part of the labels or in certain cases it does not show it.
The height is like this:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
// Calculo
if(!self.myCell) {
self.myCell = [self.tabla dequeueReusableCellWithIdentifier:@"DynamicTableViewCell"];
}
// Config
self.myCell.label.text = [_dataSource[indexPath.row] uppercaseString];
self.myCell.label2.text = [_dataSource[indexPath.row] uppercaseString];
// Layout
[self.myCell layoutIfNeeded];
[self.myCell setNeedsLayout];
// Altura
CGFloat height = [self.myCell.contentView systemLayoutSizeFittingSize:UILayoutFittingExpandedSize].height;
return height;
}
Additionally, my labels have constraints on the Superview and a space between them. In addition, its number of lines is 0 and its break mode (Line Break) is Word Wrap
UIImageview
How can I get the name of the image that has an or UIButton
or assigned to it?UILabel
I have in a SQLite database more than 10,000 records with products, and in a folder I have the images of said products, only I cannot load them all in one UiTableView
in Objective C.
I know that what I should do is load only the ones the user is going to see and a few more for when they scroll, but I can't find any example code for this, and my English is not that great.
For now I am only loading a limit of 1500 records in a NSArray
, so that the device memory is not overloaded, but I need to be able to view all the products and that they load as I scroll (without loading times).
Does anyone know how to do this? What control do you have to use? Is the used for this?, or do I make queries every time the scrollNSCache
moves , I'm not very clear on how to do it, I load the images from a project folder, so there's not much of a problem, I just tell the load from there, with the product reference.imageview
I have an object with an image and I would need to modify the dimensions of the image to a certain height (example 50px), but keeping the scale (the ratios).
UIImage *thumbImage = [UIImage imageNamed:@"peon.png"];
What would be a function that can do this?