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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:46:54+00:00 2026-06-17T06:46:54+00:00

I dont’t see last button (bx), when first button array too big, for example

  • 0

I dont’t see last button (bx), when first button array too big, for example size is 12, when size is 2 I see it. Why button doesn’t transition to second row.

protected void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        LinearLayout linLayout = new LinearLayout(this);
        linLayout.setOrientation(LinearLayout.HORIZONTAL); 
        LayoutParams linLayoutParam = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); 
        setContentView(linLayout, linLayoutParam);
        int size=20;
        Button[] mButtonsArray = new Button[size];

        LayoutParams Lpx= new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

        for (int i=0; i< size;i++) 
        {
       mButtonsArray[i]= new Button(this);
            mButtonsArray[i].setText(name);
            linLayout.addView(mButtonsArray[i], Lpx);
        }
       Button bx = new Button(this);
       bx.setText("back");
        linLayout.addView(bx, Lpx);
    }
  • 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-17T06:46:55+00:00Added an answer on June 17, 2026 at 6:46 am

    Because, your LinearLayout linLayout has gravity HORIZONTAL

    linLayout.setOrientation(LinearLayout.HORIZONTAL); 
    

    if you want to add last button in second row then you have to make a Root LinearLayout with VERTICAL then add other buttons with parent LinearLayout with HORIZONTAL gravity and add this LinearLayout to Main Root LinearLayout with Gravity VERTICAL.

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

Sidebar

Related Questions

I dont really understand whats going on and cant see the difference: I'm downloaded
Dont understand why I am getting stack level too deep when I run this
I dont really know too much about Rewrite in apache, but there is problem
I dont want to use forms. I want to have a submit button and
Dont why this is happening I have a method getOutage which returns an array
I dont quite understand how to change (decrease) the font size for the text
I dont understand why my xpath query returns the correct href for the second
I dont know if this is possible. In SSIS Derived column transformation, can you
I dont really know how to explain exactly what function i need but ill
I dont know how to debug structures like: fun1 <- function(obj){ a<-c(obj,4) c(a,5) }

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.