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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:42:38+00:00 2026-06-10T18:42:38+00:00

I want to draw 26 buttons for keyboard. There are 3 rows. First row

  • 0

I want to draw 26 buttons for keyboard. There are 3 rows. First row has 10 button, second has 9, and the third has 7. The space from one button to another is 5. Each button has width: 27 and height: 40. How can I draw them at the same time ?

  • 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-10T18:42:40+00:00Added an answer on June 10, 2026 at 6:42 pm

    You can button like this:- it is not the solution of ur problem but.. u will still get the idea from that code.-

        objDelegate.redColorArray = [[NSMutableArray alloc] initWithObjects:@"255",@"215",@"242",@"198",@"204",@"119",@"217",@"149",@"112",@"79",@"247",@"55",@"0",@"0",@"255",@"16", nil];
        objDelegate.greenColorArray = [[NSMutableArray alloc] initWithObjects:@"255",@"228",@"220",@"217",@"193",@"147",@"150",@"179",@"48",@"98",@"150",@"96",@"0",@"176",@"0",@"37", nil];
        objDelegate.blueColorArray = [[NSMutableArray alloc] initWithObjects:@"255",@"189",@"219",@"241",@"218",@"60",@"148",@"215",@"160",@"40",@"70",@"146",@"0",@"80",@"0",@"63", nil];
    
        UIButton *btn[16];
    
        buttonArray = [[NSMutableArray alloc] init];
    
        int x=0;
        int y=0;
       for (int i=0; i<16; i++)
        {
            btn[i] = [[UIButton alloc] initWithFrame:CGRectMake(x, y, 15, 15)];
    
            [btn[i] setBackgroundColor:[UIColor colorWithRed:[[objDelegate.redColorArray objectAtIndex:i]floatValue]/255.0 green:[[objDelegate.greenColorArray objectAtIndex:i]floatValue]/255.0 blue:[[objDelegate.blueColorArray objectAtIndex:i]floatValue]/255.0 alpha:1]];
    
            btn[i].tag = i;
    
            [btn[i] addTarget:self action:@selector(setColor:) forControlEvents:UIControlEventTouchUpInside];
    
            [buttonArray addObject:btn[i]];
    
            [self addSubview:btn[i]];
    
            x+=20;
    
            if((i+1)%4==0)
            {
                x=0;
                y+=20;
           }
        }
    

    it will show button like this
    Button image

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

Sidebar

Related Questions

I want to draw 2 buttons in one cell and when the button is
I want to draw a <hr> line in CSS. And there is a button
I want to draw buttons above a button onClick. For Example If i have
I want to draw an area from given points on a map using the
I want to draw a rectangle on button click event horizontally aligned to the
Think tic-tac-toe. You are creating the buttons in rows and columns and you want
I want to draw custom button on Navigation bar. Can anybody help me.
I want to draw onto a button whenever the mouse enters it. I want
I want to make a matrix of buttons and, while a button gets clicked
I want to add buttons one below the other. I have this simple code:

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.