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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T21:27:17+00:00 2026-05-28T21:27:17+00:00

In my table view i was using UITableviewCEllStyleValue1: if (cell == nil) { cell

  • 0
  • In my table view i was using UITableviewCEllStyleValue1:

 if (cell == nil) 
        {
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentifier] autorelease];

     cell.textLabel.text = @"Hai";
                cell.detailTextLabel.text = @"Hello";

        cell.detailTextLabel.textAlignment = UITextAlignmentLeft;
        cell.textLabel.textAlignment = UITextAlignmentLeft;
        return cell;

        }

  • Here two labels text labe, detailTextLabel are displayed.

  • but not in the position what i want.

  • I need to display Textlable from starting position of the cell (0,0) and immidiate right side position is detailTextlabel no gap between two labels.

  • I need a solution with out using Allignment. what to do?
  • 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-28T21:27:17+00:00Added an answer on May 28, 2026 at 9:27 pm

    You have to create custom cell for this. like this,

    in CustomCellTableViewCell.h file

    #import <UIKit/UIKit.h>
    
    @interface CustomCellTableViewCell : UITableViewCell
    @property(nonatomic,strong)UILabel *lblUnit;
    @end
    
    in CustomCellTableViewCell.m file
    
    #import "CustomCellTableViewCell.h"
    
    @implementation CustomCellTableViewCell
    
    - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
    {
        self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
        self.userInteractionEnabled = YES;
        if (self) {
            // Initialization code
            self.lblUnit = [[UILabel alloc]init];
            [self.lblUnit setTextColor:[UIColor whiteColor]];
                [self.lblUnit setFont:[UIFont fontWithName:@"Roboto-Light" size:30.0f]];
           // [self.lblUnit setFont:[UIFont systemFontOfSize:18.0]];
            self.lblUnit.textAlignment = UIBaselineAdjustmentAlignCenters;
            self.lblUnit.adjustsFontSizeToFitWidth = YES;
            [self.contentView addSubview:self.lblUnit];
           }
        return self;
    }
    
    @end
    
    in your Tableview CellForRowAtIndexpath write below code
    
          cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
    
        if(cell==nil){
            cell = [[CustomCellTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
        }
    
         cell.lblUnit.frame = CGRectMake(0, 10, 150, 40);
         cell.lblUnit.text = @"Hai";
         return cell;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using apple's custom table view cell code and modifying the drawRect code
I place a single table view cell on my view using interface builder and
I am trying to build a custom table view using a cell that I
Given an ASP.NET MVC view that generates a table of entries using a for
I have a Table View Controller with cells. I want to update the text
I am using table view for editing an object . I am using below
I've created a table view in an iPhone app using Interface Builder (IB). My
I am trying to load my table view using plist file. But when i
I created a new custom TableViewCell by subclassing UITableViewCell. I created a table view
I'm using Core Data for a table view, and I'd like to use the

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.