Solved

Issue with text overlapping in table view when scrolling up and down

Posted on 2013-12-31
5
1,034 Views
Last Modified: 2014-02-01
I have a table in a view controller with text. When I scroll up and down, the text starts overlapping. I have included a couple of screen shots of the screen before and after I start scrolling. This issue just started when I began updating my app in xcode 5 for ios 7. This one has me stumped. Any ideas would be greatly appreciated.
Screen-Shot-2013-12-31-at-3.27.1.png
Screen-Shot-2013-12-31-at-3.27.3.png
0
Comment
Question by:dmalovich
  • 2
  • 2
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39757981
How do you construct that screen?
How is the scroll managed (assuming UIScrollView)?
0
 

Accepted Solution

by:
dmalovich earned 0 total points
ID: 39758093
I have figured out a solution. My original code was:

    CGRect delayLabelFrame = CGRectMake(10, 45, 140, 15);
      UILabel *delayLabel = [[UILabel alloc] initWithFrame:delayLabelFrame];
      delayLabel.font = [UIFont systemFontOfSize:12];
    delayLabel.text =  @"Passenger Vehicle Delay:";
    [cell.contentView addSubview:delayLabel];


What I needed to do was add a tag and check if the view was reprinted to the screen. My new code is:

    CGRect delayLabelFrame = CGRectMake(10, 45, 140, 15);
      UILabel *delayLabel = [[UILabel alloc] initWithFrame:delayLabelFrame];
      delayLabel.font = [UIFont systemFontOfSize:12];
    delayLabel.text =  @"Passenger Vehicle Delay:";
    delayLabel.tag = 5;
    if ([cell.contentView viewWithTag:5])
    {
        [[cell.contentView viewWithTag:5]removeFromSuperview];
    }
      [cell.contentView addSubview:delayLabel];
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39758311
I am trying to figure out how that helps you?
0
 

Author Closing Comment

by:dmalovich
ID: 39826058
I have figured out a solution. I have posted the code.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

iCloud Drive was introduced after iOS 8 was launched last year. This drive is Apple’s online storage device that lets users sync their files and access them from all their Apple devices.   There is a lot of data that is not automatically backed up…
Are you having trouble connecting or getting your iPhone / Samsung device(s) to sync with Microsoft Exchange Server?   What have you tried?   What haven't you tried?
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question