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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:47:00+00:00 2026-05-21T05:47:00+00:00

I’m building a app which has a table view. But I want this to

  • 0

I’m building a app which has a table view. But I want this to be a table view which expands the cell when you tap on it and close when you tap a second time.

But I was wondering if the following is possible. When the cell isn’t selected you only see a picture, title and the beginning of the text. But as soon as the cell is selected, it will expand and show even more subviews, i.e. image views.

Is this possible? For instance, to hide a subview in the cell, and as soon a it is tapped it’s visible and aligned the right way? And of course, how do i do that?

Thnx!!!

  • 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-05-21T05:47:01+00:00Added an answer on May 21, 2026 at 5:47 am

    I did something similar quite a few time ago. You’ll find the code at github.

    Note that it is very rough, as it where my beginning iPhone days, i.e. properties are missing.

    .h

    #import <UIKit/UIKit.h>
    
    
    @interface FirstViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource> {
        NSIndexPath *selectedIndexPath;
        NSDictionary *articles;
    }
    
    @end
    

    .m

    #import "FirstViewController.h"
    @implementation FirstViewController
    - (void)viewDidLoad {
        [super viewDidLoad];
        selectedIndexPath = nil;
        articles = [[NSDictionary dictionaryWithObject:[NSArray arrayWithObjects:@"one", @"two", @"three",
                                                        @"four", @"five", @"six",
                                                        @"seven", @"eight", @"nine",
                                                        @"ten", @"eleven", nil]
                     forKey:@"title"] retain];
    }
    - (void)didReceiveMemoryWarning {
        // Releases the view if it doesn't have a superview.
        [super didReceiveMemoryWarning];
        // Release any cached data, images, etc that aren't in use.
    }
    - (void)viewDidUnload {
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    }
    - (void)dealloc {
        [selectedIndexPath release];
        [articles release];
        [super dealloc];
    }
    
    - (int)numberOfSectionsInTableView:(UITableView *)tableView
    {
        return [[articles allKeys] count];
    }
    
    - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
    {
        return [[articles allKeys] objectAtIndex : section];
    }
    
    - (int)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section
    {
        id key = [[articles allKeys] objectAtIndex:section];
        return [[articles objectForKey : key] count];
    }
    
    - (float)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        if ((selectedIndexPath != nil) && (selectedIndexPath.row == indexPath.row))
            return 80.0;
        return 40.0;
    }
    
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        static NSString * MyIdentifier = @"MyIdentifier";
        UITableViewCell * cell = [self.tableView dequeueReusableCellWithIdentifier:MyIdentifier];
        if (cell == nil) {
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier] autorelease];
        }
        id key = [[articles allKeys] objectAtIndex:indexPath.section];
        cell.textLabel.text = [[articles objectForKey:key] objectAtIndex:indexPath.row];
        return cell;
    }
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        if (selectedIndexPath == indexPath) {
            selectedIndexPath = nil;
        } else {
            selectedIndexPath = indexPath;
        }
        [self.tableView deselectRowAtIndexPath : indexPath animated : NO];
        [tableView beginUpdates];
        [tableView endUpdates];
    }
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.