Solved

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

Posted on 2013-12-31
5
975 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
Comment Utility
How do you construct that screen?
How is the scroll managed (assuming UIScrollView)?
0
 

Accepted Solution

by:
dmalovich earned 0 total points
Comment Utility
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
Comment Utility
I am trying to figure out how that helps you?
0
 

Author Closing Comment

by:dmalovich
Comment Utility
I have figured out a solution. I have posted the code.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Are you looking to clear some space on your phone for the latest iOS 8 update? Did you switch to Spotify so you no longer need to keep music native on your phone? Run out of space for taking photos while in the middle of vacation? Sometimes the quic…
There is a security feature on iOS devices that is nearly impenetrable when it has been activated.  This article will provide some possible solutions as well as necessary steps to take to ensure you do not end up with a locked device.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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.

771 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

10 Experts available now in Live!

Get 1:1 Help Now