I am trying to add 2 labels in my table view cell. when in portrait mode the both labels overlap each other and in landscape mode it works fine.
I have also used auto-layout . Where i have to make changes to achieve the target.
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *MyIdentifier = @"ProductTableViewCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier];
}
UILabel * productName= (UILabel *)[cell viewWithTag:101];
//productName.text=[[productDetails objectAtIndex:indexPath.row]product_Name];
// similar code for another label also
productName.lineBreakMode= NSLineBreakByWordWrapping;
productName.numberOfLines=0;
productName.text= @"asdfasdfsdzxcvzasdfaxv";
[productName sizeToFit];
return cell;
}
Link for Issue for better description : http://f.talk.to/3afcd0c13764064184c01cc4
Thanks in advance :)