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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:33:09+00:00 2026-06-12T11:33:09+00:00

I want to create a view like this in my iPhone App: I do

  • 0

I want to create a view like this in my iPhone App:

enter image description here

I do not know exactly what is this control in iOS, that maybe I can set an icon and text in the left side and that small sign in the right side.

I have implemented a TableView, there I was able to set these stuff, like this:

    [[cell textLabel] setText:customer.name];
    [[cell textLabel] setTextColor:[UIColor blackColor]];
    [[cell imageView] setImage:[UIImage imageNamed:@"icon.png"]];
    //[[cell detailTextLabel] setText:@"Awsome weather idag"];
    cell.accessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];  

But how can I make it works like that view in the picture?

  • 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-12T11:33:10+00:00Added an answer on June 12, 2026 at 11:33 am

    It is pretty simple, follow the steps below and in case of doubts check out the UITableView documentation:

    1. Create a grouped table view:

    Programmatically:

    CGRect tableFrame = CGRectMake(0, 0, 200, 200);
    
    UITableView *tableView = [[UITableView alloc] initWithFrame:tableFrame style:UITableViewGroupedStyle];
    tableView.delegate = self;
    tableView.dataSource = self;
    
    [self.view addSubview:tableView];
    

    Allocating a UITableViewController subclass (common case):

    MyTableViewController *controller [[MyTableViewController alloc] initWithStyle: UITableViewGroupedStyle];
    
    [self.navigationController pushViewController:controller animated:NO];
    

    Through Interface Build:

    1. Expand the Utilities Menu (top right corner icon);
    2. Select your table view (click on it);
    3. Click on the attributes inspector (top right corner fourth icon);
    4. Under Table View, click on the style dropdown and select grouped.

    2. Implement the UITableViewDataSource protocol:

    Basically add this three functions to your controller.

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
        // Return the number of sections.
    
        return 1;
    }
    
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
        // Return the number of rows in a given section.
    
        return 5;
    }
    
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
        // Configure the cells.
    
        return cell;
    }
    

    3. Configuring the cells:

    The default style of a UITableViewCell has an image view (UIImageView), a title label (UILabel) and an accessory view (UIView). All you need to replicate the table view in the image you provided.

    So, you’re looking for something like this in tableView:cellForRowAtIndexPath::

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
        static NSString * const cellIdentifierDefault = @"default";
    
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifierAccount];
    
        if (cell == nil) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifierAccount];
        }
    
        if (indexPath.section == 0) {
    
            cell.imageView.image = [UIImage imageName:@"bluetooth_icon"];
            cell.textLabel.text = @"Bluetooth";
    
            // Additional setup explained later.
    
        }else{
    
            if (indexPath.row == 0) {
    
                cell.imageView.image = [UIImage imageName:@"general_icon"];
                cell.textLabel.text = @"General";
                cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    
            }else{
    
                cell.imageView.image = [UIImage imageName:@"privacy_icon"];
                cell.textLabel.text = @"Privacy";
                cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    
            }
    
        }
    
        return cell;
    }
    

    The property accessoryType defines what is going to appear on the right side of a cell, a list of accessory types can be found here.

    In the first cell (bluetooth), you’ll need to create a custom accessory view and assign it to the cell’s accessoryView property. A very naive example of how to achieve this is given below:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
        static NSString * const cellIdentifierDefault = @"default";
    
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifierAccount];
    
        if (cell == nil) {
    
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifierAccount];
    
            label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 44)];
            label.textAlignment = NSTextAlignmentRight;
    
            cell.accessoryView = label;
    
        }else{
    
            label = (UILabel *) cell.accessoryView;
    
        }
    
        cell.imageView.image = [UIImage imageName:@"bluetooth_icon"];
        cell.textLabel.text = @"Bluetooth";
        label.text = @"Off";
    
        return cell;
    }
    

    Hope this helps, Mateus

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

Sidebar

Related Questions

i m new to iphone development i want to create a view like this..
I want to create a generic html table to excel file view that can
I want to create a page flipping transition for an iPhone app like the
I want to create a view that contains two forms with their submit buttons.
I want to create a custom alert view within my iOS application. For example,
I want to create a query in TFS that allows me to view only
I want to create simple app able to edit images. Main view of app
In the iPhone app I'm currently working on, I'd like two view controllers (I'll
I am trying to create a contacts like app for iphone where the name
I want to add a custom table to my iPhone app, that should look

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.