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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:46:52+00:00 2026-05-19T04:46:52+00:00

I am fairly new to Core Text but have been getting on well, however

  • 0

I am fairly new to Core Text but have been getting on well, however I’m having trouble adjusting the width of a tab.

Currently I’m using this code which I have written by looking at the documentation and mailing list:

    CFIndex theNumberOfSettings = 1;

    CFIndex i = 0; 
    CTTextTabRef tabArray[1]; 
    CTTextAlignment align = 0; 
    CGFloat location = 80; 
    for (;i < 1; i++ ) { 
        tabArray[i] = CTTextTabCreate( align, location, NULL ); 
    }       
    CFArrayRef tabStops = CFArrayCreate( kCFAllocatorDefault, (const void**) tabArray, 1, &kCFTypeArrayCallBacks );     
    for (;i < 1; i++ ) { CFRelease( tabArray[i] ); } 

    CTParagraphStyleSetting theSettings[1] =
    {
        { kCTParagraphStyleSpecifierTabStops, sizeof(CFArrayRef), &tabStops },
    };

    CTParagraphStyleRef paragraphStyle = CTParagraphStyleCreate(theSettings, theNumberOfSettings);
    [self.attributedString addAttribute:(NSString *)kCTParagraphStyleAttributeName 
                                  value:(id)paragraphStyle
                                  range:range];

By setting the value of location I am able to adjust the width of the tab however this only works for the first tab created after that it resets to a different width which is very small comparatively.

Why is it doing this?

  • 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-19T04:46:53+00:00Added an answer on May 19, 2026 at 4:46 am

    I would imagine the issue is all your tabs are created with the exact same location. Each one should probably be a multiple of 80, rather than being exactly 80.

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

Sidebar

Related Questions

I'm fairly new to clojure but I've been having trouble finding good resources and
So I'm fairly new to Core Data and KVO, but I have an NSManagedObject
Being fairly new to programming, I am having trouble understanding exactly what Homebrew does...
I am fairly new to php and mysql but I have created a small
I am fairly new to Core Data and have run into an issue which
Hi I am fairly new to core data and have recently started doing some
Fairly new to .Net here and having trouble with a line of code. I
I am fairly new at core data and am having a problem. My app
I am fairly new to core data technology and i searched a lot on
I am new to fairly new to AS3 and I have found myself needing

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.