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

  • Home
  • SEARCH
  • 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 6366229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:23:42+00:00 2026-05-25T00:23:42+00:00

My application is looking like the below image I have 3 buttons in my

  • 0

My application is looking like the below image

enter image description here
enter image description here

I have 3 buttons in my segmented control. Assume that hitting the “Department” button will display 3 departments & hitting “Name” button will show 6 names.

I follow the below steps to make this..

  1. Create UISegmentedControl by this code

    segmentedControl = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"Department", @"Name", @"ID",nil]];  //Initialize Segmented Control
    
    segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar; //Define bar type (optional)
    
    segmentedControl.selectedSegmentIndex = 0; //Define default clicked button
    
    [segmentedControl addTarget:self action:@selector(segmentClicked) forControlEvents:UIControlEventValueChanged];  //Set target and define which method should called when tapping buttons
    
    self.navigationItem.titleView = segmentedControl; //To add UISegmented Control in the title of the navigation bar
    
  2. Define the method(segmentClicked) for UISegmented Control

    segment = segmentedControl.selectedSegmentIndex;
    
    if (segment==0) {
        //Do something for Department tab
        [self.tableView reloadData];
    }
    
    else if (segment==1) {
        //Do something for Name tab
        [self.tableView reloadData];
    }
    
    else {
        //Do something for ID tab
        [self.tableView reloadData];
    }
    
  3. Create the cells with reference to the value of segment in tableView: cellForRowAtIndexPath: method. (So that we can get various cells for each UISegmentedControl buttons)

    if (segment == 0) {
    
        cell.textLabel.text = [listOfDepartments objectAtIndex:indexPath.section]; //listOfDepartments is the NSMutableArray that contains list of Departments names
    
    }
    
    else if (segment == 1) {
    
        cell.textLabel.text = [listOfNames objectAtIndex:indexPath.section];  //listOfNames is the NSMutableArray that contains list of person names
    
    }
    
    else {
    
        cell.textLabel.text = [listOfIDs objectAtIndex:indexPath.section];  //listOfIDs is the NSMutableArray that contains list of person ID's
    
    }
    
    return cell;
    

So, finally i got the view showed in the above image.

When i press on the UISegmentedControl buttons, the table view reloads its cells & showing corresponding values perfectly. By default, the “Department” button was selected. If i tap the “Name” button(that is, table will show 6 cells instead of 3), The table changes immediately without any animations. It simply hide 3 cells of department names and showing 6 cells that displaying names of persons without any animations. I could not find a way to making the cell changes with smooth animations.

What should i implement to achieve the smooth animations?

Thanks in Advance

  • 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-25T00:23:43+00:00Added an answer on May 25, 2026 at 12:23 am

    Use insertRowsAtIndexPaths:withRowAnimation: and deleteRowsAtIndexPaths:withRowAnimation: methods which has options for specifying some build-in cool animations.

    typedef enum {
        UITableViewRowAnimationFade,
        UITableViewRowAnimationRight,    
        UITableViewRowAnimationLeft,
        UITableViewRowAnimationTop,
        UITableViewRowAnimationBottom,
        UITableViewRowAnimationNone,        
        UITableViewRowAnimationMiddle,      
    } UITableViewRowAnimation;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a small PHP application that I'd like to distribute. I'm looking for
I have some javacsript code looking something like below. Notice how it makes a
My application is looking like the below snap in some scenario. There is one
How would you design a hosted web application? I'm looking at applications like Basecamp,
i am looking for svn admin a desktop application like VisualSVN Server only for
I'm looking to write a notification application where I'd like to provide popup notifications
I'm looking into building a distributed application and would like some advice on the
I'm looking to build a tree-like structure for my Java application. I've tried using
I'm looking for schemes for application version or milestone naming . I'd like to
Looking for a toolkit/SDK for general Blackberry development or application toolkits. Anything like an

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.