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 6881019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:03:15+00:00 2026-05-27T05:03:15+00:00

I have a UITableview with standard UITableViewCells . On selecting a cell, I would

  • 0

I have a UITableview with standard UITableViewCells. On selecting a cell, I would like to replace that cell with a custom cell with UITextViews instead of the detailTextLabel and UITextFields instead of the accessoryView. What would be the best way to go about implementing this?

  • 1 1 Answer
  • 1 View
  • 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-05-27T05:03:16+00:00Added an answer on May 27, 2026 at 5:03 am

    Create a subclass of UITableViewCell. Add in your UITextField or UITextField (whichever is appropriate for your solution) to the contentView, and make them hidden. Override the `-setSelected:animated:’ method:

    - (void)setSelected:(BOOL)selected animated:(BOOL)animated
    {
      [super setSelected:selected animated:animated];
      if ( animated ) {
        // using old-school UIView animation support to fade in/out controls,
        // block-based much easier, but only 4.0 or greater
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
        self.textLabel.alpha = (selected) ? 0.0 : 1.0;
        self.detailTextLabel.alpha = (selected) ? 0.0 : 1.0;
        // assumed you added a UITextView 'textView' ivar
        self.textView.alpha = (selected) ? 1.0 : 0.0;
        [UIView commitAnimations];
      }
      else {
        self.textLabel.hidden = selected;
        self.detailTextLabel.hidden = selected;
        self.textView.hidden = !selected;
      }
    }
    
    - (void)animationDidStop:(NSString *)animationID finished:(BOOL)finished context:(void *)context
    {
      self.textLabel.hidden = self.selected;
      self.detailTextLabel.hidden = self.selected;
      self.textView.hidden = !self.selected;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UITableView with standard UITableViewCells that contain an image on the left.
I have a standard, grouped UITableView that I am trying to add a custom
I have a UITableView cell that is going to have a variable size depending
I have a UITableView that displays single large images in each cell. The names
I have a uitableview that loads fairly large images in each cell and the
I have a grouped UITableView that contains several cells (just standard UITableViewCell s), all
I have a UITableView and I want some cells to be the standard UITableViewCells
I have a UITableView with 5 UITableViewCells . Each cell contains a UIButton which
Short Intro Currently I have a UITableView which is filled with custom cells that
I have a UITableView that represents a list of objects, I'd like the user

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.