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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:09:02+00:00 2026-06-03T02:09:02+00:00

First of I’m very sorry to ask this doubt. I created a table view

  • 0

First of I’m very sorry to ask this doubt.

I created a table view cell and tried to align it to center.But this is doing nothing.just align in left itself.

This is the code i used.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    if(indexPath.section == 0){


    SDSCaseListCustomCell *customCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
//    if (customCell == nil) 
    {
        NSArray *cells =[[NSBundle mainBundle] loadNibNamed:@"SDSCaseListCustomCell" owner:nil options:nil];

        for (UIView *view in cells) 
        {
            if([view isKindOfClass:[UITableViewCell class]])
            {
                customCell = (SDSCaseListCustomCell*)view;
            }
        }
    }
    SDSCase *cases  = [caseList objectAtIndex:indexPath.row];

    customCell.doctor.text = cases.referredDoctor;
    customCell.hospital.text = cases.hospital;  
    //customCell.time.text = cases.referredDoctor;  
    customCell.caseId.text =cases.caseId;  


    return customCell;
    }
    else 
    {
        UITableViewCell  *loadMore = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (loadMore == nil) 
        {

            loadMore = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];

        }


        loadMore.textLabel.text = @"loadMore";
         loadMore.textLabel.textAlignment = UITextAlignmentCenter; 

            return loadMore;
    }


}

Can anybody please help me where I’m going wrong.

Thanks in advace.

  • 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-03T02:09:03+00:00Added an answer on June 3, 2026 at 2:09 am

    use indentationLevel

    indentationLevel Adjusts the indentation level of a cell whose content
    is indented.

    @property(nonatomic) NSInteger indentationLevel Discussion The default
    value of the property is zero (no indentation). The width for each
    level of indentation is determined by the indentationWidth property.

    Availability Available in iOS 2.0 and later. Declared In
    UITableViewCell.h

    Edit:

    If you want to you can create your own label and added as a subview to the contentView. You can not change the alignment of the textLabel the alignment is controlled by the UITableViewCellStyleSubtitle

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

Sidebar

Related Questions

first of all, sorry if that question is dumb but I´m a total newbie
First of all, I am sorry if this question doesn't belong to SO since
First, please tell me if I'm not allowed to ask about this protocol here...
First time posting here, will try to be succinct. This is a classic 'can't
First I will ask users How many names you want to enter?. Once they
first of all sorry for my bad english. I got a working PagerAdapter with
First, my question might sound like a duplicate, but I have been going through
first, sorry for my bad English. I try to rewrite url generated from Form
First, i already read the question jQuery Grid Recommendations but it doesn't answer to
First let me apologize a bit for the length of this post, it's mostly

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.