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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:21:52+00:00 2026-05-30T15:21:52+00:00

i have description , title in a cell .. some of the title has

  • 0

i have description , title in a cell .. some of the title has description some doesnt have . i want to animate ( increase the size ) the row based upon description , if there is no description the cell shouldnt increase the size where as if there is description the cell should increase . the data of title and description is fetched from sql db .i have created the animation part , i am having trouble in increase the size of cell only for description part .. – (void)tableViewUITableView *)tableView cellForRowIndexNSIndexPath *)indexPath i have defined descriptionlabel which gets value from descriptionArray

- (BOOL)cellIsSelected:(NSIndexPath *)indexPath;

@end

@implementation LOAnimatedCellDemoViewController

#define kCellHeight 50.0

- (void)viewDidLoad {
    [super viewDidLoad];

    selectedIndexes = [[NSMutableDictionary alloc] init];
}

- (void)viewDidUnload {
    [selectedIndexes release];
    selectedIndexes = nil;

    [super viewDidUnload];
}

- (BOOL)cellIsSelected:(NSIndexPath *)indexPath {
    // Return whether the cell at the specified index path is selected or not
    NSNumber *selectedIndex = [selectedIndexes objectForKey:indexPath];
    return selectedIndex == nil ? FALSE : [selectedIndex boolValue];
}



#pragma mark -
#pragma mark Tableview Datasource Methods

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 20;
}

#pragma mark -
#pragma mark Tableview Delegate Methods

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Deselect cell
    [tableView deselectRowAtIndexPath:indexPath animated:TRUE];

    // Toggle 'selected' state
    BOOL isSelected = ![self cellIsSelected:indexPath];

    // Store cell 'selected' state keyed on indexPath
    NSNumber *selectedIndex = [NSNumber numberWithBool:isSelected];
    [selectedIndexes setObject:selectedIndex forKey:indexPath]; 

    // This is where magic happens...
    [demoTableView beginUpdates];
    [demoTableView endUpdates];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    // If our cell is selected, return double height
    if([self cellIsSelected:indexPath]) {
        return kCellHeight * 2.0;
    }

    // Cell isn't selected so return single height
    return kCellHeight;
}

@end
  • 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-30T15:21:53+00:00Added an answer on May 30, 2026 at 3:21 pm

    in if([self cellIsSelected:indexPath]) line i added

    if([self cellIsSelected:indexPath] && ![descriptionArray objectAtIndex:indexpath.row] isEqualToString:@" "])
    i gave isEqualToString:@” “ cause in database column for items which has no description i gave single space character so that it indicates there is no description is available for the item –

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text like: Title A some description on a few lines, there
I have a list, that has three fields: Title, PublishingRollupImage and Description. I want
I have these two tables: Galleries - {id,title,description} Images - {id,gallery_id,file} Each gallery has
I am making an android application,I have 4 textviews namely ProductId,Title,description,image.I want when i
I have a description text file with content constructed in such manner: Book title
I have a SharePoint list with columns as below: Columns: Title | Description |
Suppose i have a json object friends as: { title: Friends link: /friends.json description:
I have a search result like 1. my title my short description...... http://www.stackoverflow.com/tags/thisthat/againthisthat/againandagainthisthat/mypage.html http://www.stackoverflow.com/tags/mypage.html?a=123123123&b=2342343
have such zend query: $select = $this->_table ->select() ->where('title LIKE ?', '%'.$searchWord.'%') ->where('description LIKE
Let's say I have the following SQL query SELECT id, name, title, description, time

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.