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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:51:14+00:00 2026-06-15T23:51:14+00:00

I have a relative layout with textviews ordered in more then one column. When

  • 0

I have a relative layout with textviews ordered in more then one column. When clicked on screen, there is a “popup screen” or “input screen” (have no idea how it is called) in which I define the time “from” and “to”, what is the name of school class etc. It will compute which textviews it needs to merge from that input. Merged textviews have to be like one larger textview. Is it possible to do something like this?

Thanks for the answer in ahead.

Something like this:
https://i.stack.imgur.com/r1o8D.png

  • 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-15T23:51:15+00:00Added an answer on June 15, 2026 at 11:51 pm

    I’ve got an idea you could try creating a custom view to draw this instead of using views.

    Extend the View class in a new class and override the onDraw method.

    //variables
    Paint paint[]; //Set up these paints with the colors you need
    int rowWidth, int colHeight;
    void onDraw(Canvas c){
        for(int i=0;i<noOfRows;i++){
           for(int j=0;j<noOfColumns;j++){
                if(cellRequired(i,j)){
                  //cellRequired will be whatever logic you have to check if cell is required
    
                    int rectHeight=colHeight; //Now the Rect Height changes whether the cell
                                             //  below is in use or not.
                    for(int k=i;k<noOfRows;k++){                         
                         //This loop will run through the rows and see if merging is required
                          if(cellRequired(i,k))
                                 rectHeight+=colHeight; //Merge Cell
                          else 
                                  break; //If not required at any point break loop
                     }
                     //Draw Rectangle background
                     c.drawRect(i*rowWidth +i, j*colHeight +j, rowWidth, rectHeight, backPaint);
                     //Draw Text
                     canvas.drawText("Text",i*rowWidth +i, j*colHeight +j, paint[requiredPaint]);
                     //I added the plus i and plus j so there'd be a gap in the rectangles
                     // Then it will be a border
                }         
           }
        }
    }
    

    Android documentation on custom controls
    you

    Android: Tutorial on Custom View creation

    How to make a custom view similar to above

    http://www.droidnova.com/playing-with-graphics-in-android-part-i,147.html

    Go through these and then through the code above. Hopefully it should show you how to implement it.

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

Sidebar

Related Questions

I have got relative layout, in that i have placed two textviews, one image
I created one linear layout and I have added two relative layout. I wish
Ok I have a relative layout inside a linear one.Until now,the relative layout was
I have two cases with Linear (also tried Relative) layout in android. The one
I'm using Relative Layout to create a calculator screen, and i have a row
In a vertical linear layout, I have 2 textviews, then a button and then
I have a layout containing two textViews and one ImageView. the first text is
I have a relative layout defined in a xml file(say realtive.xml). In another layout
I have imageView inside a relative layout. And when i create the activity i
I have to add a custom layout in a relative layout on a button

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.