Solved

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

Posted on 2013-12-31
5
990 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iPhone 6S IOS - Freeing up space in mail is NOT working 16 67
When was iOS 9,3.5/ Pegasus information released 3 42
iOS10 upgrade 1 31
"Phones" option in Outlook Web App 3 72
The Basics of Storyboard Storyboards were first introduced to developers in the release of iOS 5. They save the developer the trouble of designing each screen’s interface in a different file. The storyboard allows you to see the conceptual mockup o…
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.
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

867 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now