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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:08:54+00:00 2026-06-13T15:08:54+00:00

I have the following code: UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setTitle:@My Title forState:UIControlStateNormal];

  • 0

I have the following code:

UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setTitle:@"My Title" forState:UIControlStateNormal];
button.frame = myCustomRect;
UIColor *fontColor = [UIColor colorWithRed:0.43 green:0.84 blue:0.86 alpha:0.9];
[button setTitleColor:fontColor forState:UIControlStateNormal];
button.backgroundColor = [UIColor whiteColor];
button.titleLabel.textAlignment = NSTextAlignmentCenter;
button.titleLabel.font = [UIFont fontWithName:@"Cooperplate" size:9];
[button addTarget:self
                action:@selector(moreDetails:)
 forControlEvents:UIControlEventTouchUpInside];    
[self.view addSubview:button];

I am trying to add a button programmatically to the view.
MyCustomRect’s parameters are (0,0,75,50).

Two things:
a) No matter what font I enter, it always shows the System font.
b) The size also doesn’t change at all. I tried increasing the font size and it doesn’t change and I tried reducing the font size and it doesn’t change either.

What am I doing wrong?

  • 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-13T15:08:55+00:00Added an answer on June 13, 2026 at 3:08 pm

    You can use your own custom fonts in your project as mentioned here

    Once you add a custom font to your project, you can use it as,

    [button.titleLabel setFont:[UIFont fontWithName:@"Cooperplate" size:24.0]];
    

    First, in XCode locate the application .plist file. Usually called,
    [YOUR_APP_NAME]-Info.plist. Once you locate the file, add a new row of
    key: “Fonts provided by application”. XCode will create the first
    key/value pair for you. Here is a screenshot of my .plist file entry.

    Image

    Add the name of the font file in the “value” column. Be sure to spell
    the name of the font file EXACTLY as it is in seen in the list of
    files in your project. This is NOT the name you will be referencing
    from within your UIFont statement. This is just so your app knows
    where to find the font you will be referencing.

    Next, you need the
    name of the fontface you are going to use. Now you reference it in
    your app.

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

Sidebar

Related Questions

I have the following code: self.shareButton=[[UIButton alloc] initWithFrame:CGRectMake(0.0, 0.0, 35, 35)]; [shareButton setBackgroundColor:[UIColor blueColor]];
I have the following piece of code - (IBAction)buttonPressed: (id) sender { UIButton *button
I have this following code to add a button to my custom header for
I have the following code to create UIWebView programmatically and create UIButton on top
I have following code in html: <div> <div style=float:left;margin:0.5em> <span class=title>Label1</span><br/> <input type=text name=name1
I have a UIButton that pushes to another view controller using the following code.
I have the following code that adds a button of type UIBarButtonItem on UIToolbar
I have following code in initialization im = imread('Image02.tif'); figure(); imagesc(im); colormap(gray); [hImage hfig
I have following code <div id=main> <div id=one> </div> <div id=two> </div> <div id=three>
I have following code for updating user's column public void UpdateLastModifiedDate(string username) { using

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.