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

  • Home
  • SEARCH
  • 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 8538107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:04:06+00:00 2026-06-11T11:04:06+00:00

Sorry for my bad english. I’ve a table row and i’ve set the first

  • 0

Sorry for my bad english. I’ve a table row and i’ve set the first view with record’s code. I’ve set this view with 0px height and 0px width. But it takes me half screen! Why? Where is the mistake?

This is the code:

        try{

        txtId= new TextView(this);
        imgCategory= new ImageView(this);
        txtDescrizione= new TextView(this);
        txtDataFine= new TextView(this);
        imgPriorita= new ImageView(this);

        txtId.setText(id);
        txtId.setWidth(0);
        txtId.setHeight(0);
        txtId.setTextColor(getResources().getColor(R.color.white));
        txtId.setTextSize(1);


        if(priorita.equalsIgnoreCase("3")){
            imgPriorita.setImageResource(R.drawable.todo_priority_3);}
        else if(priorita.equalsIgnoreCase("2")){
            imgPriorita.setImageResource(R.drawable.todo_priority_2);}
        else if(priorita.equalsIgnoreCase("1")){
            imgPriorita.setImageResource(R.drawable.todo_priority_1);}

        imgPriorita.setPadding(0, 0, 0, 0);
        imgPriorita.setMaxWidth(widthDisplay/10);
        imgPriorita.setMaxHeight(40);
        imgPriorita.setScaleType(ScaleType.CENTER_INSIDE);


        txtDescrizione.setPadding(0, 0, 0, 0);
        //txtDescrizione.setText(Html.fromHtml("<i>"+descrizione+"</i>"));
        txtDescrizione.setText(descrizione);
        txtDescrizione.setTextColor(getResources().getColor(R.color.black));
        txtDescrizione.setWidth(widthDisplay/5);
        txtDescrizione.setHeight(40);
        txtDescrizione.setTextSize(12);
        //setto la descrizione su una sola riga e con true fino a quando ci stanno le lettere
        txtDescrizione.setSingleLine(true);
        txtDescrizione.setLines(1);


        txtDataFine.setPadding(0, 0, 0, 0);
        txtDataFine.setText(data.getDateTimeTodo(dataFine));
        txtDataFine.setWidth(widthDisplay/5);
        txtDataFine.setHeight(40);
        txtDataFine.setTextColor(getResources().getColor(R.color.black));
        txtDataFine.setGravity(Gravity.CENTER);
        txtDataFine.setTextSize(12);

        if(category.equalsIgnoreCase("2")){
            imgCategory.setImageResource(R.drawable.todo_category_2);}
        else if(category.equalsIgnoreCase("1")){
            imgCategory.setImageResource(R.drawable.todo_category_1);}
        else if(category.equalsIgnoreCase("3")){
            imgCategory.setImageResource(R.drawable.todo_category_3);}
        else if(category.equalsIgnoreCase("5")){
            imgCategory.setImageResource(R.drawable.todo_category_5);}
        else if(category.equalsIgnoreCase("4")){
            imgCategory.setImageResource(R.drawable.todo_category_4);}
        else if(category.equalsIgnoreCase("6")){
            imgCategory.setImageResource(R.drawable.todo_category_6);}



        imgCategory.setPadding(0,0,0,0);
        imgCategory.setMaxWidth(widthDisplay/5);
        imgCategory.setMaxHeight(40);
        imgCategory.setScaleType(ScaleType.CENTER_INSIDE);

        rowTodo[counterBackground]= new TableRow(this); 
        if((counterBackground%2)==0){
            rowTodo[counterBackground].setBackgroundColor(getResources().getColor(R.color.greyListCp));}
        else{
            rowTodo[counterBackground].setBackgroundColor(getResources().getColor(R.color.white));}

        rowTodo[counterBackground].setMinimumHeight(heightRowTodo);
        idRow_gl=Integer.parseInt(id);
        rowTodo[counterBackground].setId(idRow_gl);

        rowTodo[counterBackground].setOnClickListener(new OnClickListener() {
            public void onClick(View view_cliccata) {
                    onclickRow(view_cliccata);
            }   
        });


        imgAnagraficaTodo[counterBackground]=new ImageView(this);

        if(id_anagTodo.equals("")){}
        else{   
            imgAnagraficaTodo[counterBackground].setImageResource(R.drawable.toanag);
            imgAnagraficaTodo[counterBackground].setPadding(20, 3, 0, 0);
            imgAnagraficaTodo[counterBackground].setMinimumWidth(widthDisplay/5);
            imgAnagraficaTodo[counterBackground].setMaxHeight(40);
            imgAnagraficaTodo[counterBackground].setId(idRow_gl);
            imgAnagraficaTodo[counterBackground].setScaleType(ScaleType.CENTER_INSIDE);

            imgAnagraficaTodo[counterBackground].setOnClickListener(new OnClickListener() {
                public void onClick(View view_cliccata) {
                        Data.myHashMapVar.put("ID_TODO", view_cliccata.getId());
                        onclickImgAnagraficaTodo(view_cliccata,id_anagTodo);
                }   
            });
            arrList_AnagTodo.add(id_anagTodo);
        }

        rowTodo[counterBackground].addView(txtId);
        rowTodo[counterBackground].addView(imgPriorita);
        rowTodo[counterBackground].addView(txtDescrizione);
        rowTodo[counterBackground].addView(txtDataFine);
        rowTodo[counterBackground].addView(imgCategory);
        rowTodo[counterBackground].addView(imgAnagraficaTodo[counterBackground]);


        List_TodoList.addView(rowTodo[counterBackground]);

        } catch (Exception e) {
            e.printStackTrace();
        }

    }

And heightDisplay and widthDisplay are set in this way:

display=getWindowManager().getDefaultDisplay();
             heightDisplay=display.getHeight();
             widthDisplay=display.getWidth();

Thanks in advance!

  • 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-11T11:04:07+00:00Added an answer on June 11, 2026 at 11:04 am

    If you wan’t it gone. why not just use

    txtId.setVisibility(View.GONE);
    

    ?

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

Sidebar

Related Questions

At first sorry my bad English. I want define routing for this url: For
Sorry for bad english and bad title! I have the table post id title
at first sorry my bad English I want load model in my plugin controller
Sorry for my bad English. Just like what I asked. I have this class
First of all sorry for my bad english and Im pretty new in these
First, sorry for my bad English. I've an app which is installed on multiple
First, sorry for my bad english, I'm French. Here the problem : I have
First, sorry for my bad english. I am using the mpstat tool in Ubuntu
Sorry for bad english. bfproduct is a table and productid is primary key in
First, sorry for bad english :-) On a little website i own, i would

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.