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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:46:29+00:00 2026-05-23T14:46:29+00:00

So what I want to do is use a gridview at the top of

  • 0

So what I want to do is use a gridview at the top of my screen and a table view at the bottom half of my screen. I thought this would be easy but apparently I am wrong. And yes I did my usual search for 1 hour then post something on stackoverflow.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" 
android:layout_height="fill_parent"
android:stretchColumns="1">


<GridView 
android:id="@+id/gridview"
android:layout_width="fill_parent" 
android:numColumns="4"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:stretchMode="columnWidth"
android:gravity="center"
android:layout_height="130dp"/>

<TableLayout
android:layout_width="fill_parent" 
android:layout_height="fill_parent"
android:stretchColumns="1">

<TableRow>
    <TextView 
    android:text="Name:" 
    android:id="@+id/TextView01" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"/>


    <EditText 
    android:hint="Name"
    android:id="@+id/projectName" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"/>
</TableRow>

<TableRow>
    <TextView 
    android:text="Start" 
    android:id="@+id/startText" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"/>


    <Button
    android:text="Push"
    android:id="@+id/startdate" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"
    android:onClick="startDate"/>

</TableRow>

<TableRow>
    <TextView 
    android:text="Finish" 
    android:id="@+id/finishText" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"/>


    <Button
    android:id="@+id/finishdate" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"
    android:onClick="finishDate"/>
</TableRow>
</TableLayout>

</LinearLayout>

Maybe this is easy. Maybe I should just go to bed and do this in the morning.
Thanks for your help.

  • 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-05-23T14:46:29+00:00Added an answer on May 23, 2026 at 2:46 pm

    1) Add android:orientation="vertical" to LinearLayout.

    2) Use android:layout_height="fill_parent" for BOTH Grid n Table layout AND also add android:layout_weight="0.5" in both GridLayout and TableLayot. This will equally divide both layouts in screen.

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:stretchColumns="1" android:orientation="vertical">
    
    
        <GridView android:id="@+id/gridview" android:layout_width="fill_parent"
            android:numColumns="4" android:verticalSpacing="10dp"
            android:horizontalSpacing="10dp" android:stretchMode="columnWidth"
            android:gravity="center" **android:layout_height="fill_parent"**
            **android:layout_weight="0.5"** />
    
        <TableLayout android:layout_width="fill_parent"
            **android:layout_height="fill_parent"** android:stretchColumns="1"
            **android:layout_weight="0.5"**>
    

    Rest part remains same…

    You can try different combinations of layout_weight like 0.4 & 0.6 or 0.8 & 0.2 etc if you don’t want the layouts equally dividing the screen. But if you use layout_height to some fixed pixel or dip value, it will appear different on different devices screens… So I recommend use layout_weight parameter.

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

Sidebar

Related Questions

I have this table I created manually, and I want to use a gridview
I want to use UpdatePanel for my GridView , but the FileUpload in GridView
I want to use jQuery with a GridView which contains textboxes, but I'm stuck
I want to use CSS to format my GridView rows. I've set up my
I currently have a Gridview , And I want to use client-side validation to
I want use this 1 for using Bar code or QR code scanner. I
I want use BYTE_ORDER macro in my Xcode project but i can't because i
I want use JQuery mobile for the front-end of my mobile application, but I
I use a GridView to show list of pictures. I want to set the
I want to use the sting in gridcode Code Dim View as string View

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.