Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8165181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:28:43+00:00 2026-06-06T19:28:43+00:00

I am using the following code to show some labels and a textview in

  • 0

I am using the following code to show some labels and a textview in a tableview. But the problem is some textviews overwriting at some unwanted places while scrolling. Please help me . Thanks in advance

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }
    cell.selectionStyle                                         =   UITableViewCellSelectionStyleNone;
    cell.backgroundColor=[UIColor whiteColor];
    if (indexPath.row==0) 
    {
        UILabel *Sender = [[UILabel alloc] initWithFrame:CGRectMake(20, 10, 200, 20)];
        Sender.text=@"From Time";
        Sender.textColor=[UIColor colorWithRed:77.0/255.0 green:104.0/255.0 blue:159.0/255.0 alpha:1.0]; 
        Sender.font=[UIFont fontWithName:@"verdana" size:16];
        [cell addSubview:Sender];
        [Sender release];  

    }

    if (indexPath.row==1) 
    {
        UILabel *Sender = [[UILabel alloc] initWithFrame:CGRectMake(20, 10, 200, 20)];
        Sender.text=@"Sender";
        Sender.textColor=[UIColor colorWithRed:77.0/255.0 green:104.0/255.0 blue:159.0/255.0 alpha:1.0]; 
        Sender.font=[UIFont fontWithName:@"verdana" size:16];
        [cell addSubview:Sender];
        [Sender release];  
        UILabel *Label = [[UILabel alloc] initWithFrame:CGRectMake(30, 35, 200, 20)];
        Label.text=@"Achuthananthan";
        Label.font=[UIFont fontWithName:@"verdana" size:14];
        [cell addSubview:Label];
        [Label release]; 
    }
    if (indexPath.row==2) 
    {
        UILabel *Agenda = [[UILabel alloc] initWithFrame:CGRectMake(20, 10, 200, 20)];
        Agenda.text=@"Agenda";
        Agenda.textColor=[UIColor colorWithRed:77.0/255.0 green:104.0/255.0 blue:159.0/255.0 alpha:1.0]; 
        Agenda.font=[UIFont fontWithName:@"verdana" size:16];

        [cell addSubview:Agenda];
        [Agenda release]; 
        UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(20, 30, 280, 120)];
        textView.editable=NO;
        textView.text=[NSString stringWithString:@"Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda."];
        textView.font=[UIFont fontWithName:@"verdana" size:14];
        [cell addSubview:textView];

        [textView release];

    }
    return cell;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:28:44+00:00Added an answer on June 6, 2026 at 7:28 pm

    use this code…

     - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        cell.selectionStyle =   UITableViewCellSelectionStyleNone;
            cell.backgroundColor=[UIColor whiteColor];
    
     UILabel *Sender = [[UILabel alloc] initWithFrame:CGRectMake(20, 10, 200, 20)];
         [sender setTag:500];
    Sender.font=[UIFont fontWithName:@"verdana" size:16];
        Sender.textColor=[UIColor colorWithRed:77.0/255.0 green:104.0/255.0 blue:159.0/255.0 alpha:1.0]; 
        [cell addSubview:Sender];
        [Sender release];  
    
        UILabel *Label = [[UILabel alloc] initWithFrame:CGRectMake(30, 35, 200, 20)];
        Label.text=@"Achuthananthan";
        Label.font=[UIFont fontWithName:@"verdana" size:14];
        [Label setTag:600];
        [cell addSubview:Label];
        [Label release]; 
    
    UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(20, 30, 280, 120)];
        textView.editable=NO;
    [Label setTag:700];
        textView.text=[NSString stringWithString:@"Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda."];
        textView.font=[UIFont fontWithName:@"verdana" size:14];
        [cell addSubview:textView];
        [textView release];
    
    }
    
    UILabel *firstLabel = (UILabel*)[cell viewWithTag:500];
    UILabel *SecondLabel = (UILabel*)[cell viewWithTag:600];
    UITextView *firstText = (UITextView*)[cell viewWithTag:700];
    
    if (indexPath.row==0) 
    {
    
        firstLabel.text=@"From Time";
    [SecondLabel setHidden:Yes];
    [firstText setHidden:Yes];
    
    }
    
    if (indexPath.row==1) 
    {
    
        firstLabel.text=@"Sender";
    [SecondLabel setHidden:NO];
    [firstText setHidden:Yes];
    
    }
    if (indexPath.row==2) 
    {
        firstLabel.text=@"Agenda";
    [SecondLabel setHidden:Yes];
    [firstText setHidden:NO]; 
    }
    return cell;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following jQuery code to hide and show some HTML element in
I am using following code to remove some specific nodes from xml file..It show
I am using following code to show a spinning wheel: $(#loading) .hide() .ajaxStart(function(){ $(this).show();
I am using the following code to show a jQuery UI dialog when the
I'm using the following code in an attempt to show a dialog with a
I am using the following code to expand/collapse some text on click of a
I am using the following code to show dynamic progress dialog : public void
I'm using the following code to show a particular UITableView: the first row must
Im using the following code <script src=http://code.jquery.com/jquery-latest.js></script> <script> //Document ready $(document).ready(function(){ //Show info $('a.getinfo').live(click,
I'm using the following code to show a box when you mouseover a certain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.