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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:48:54+00:00 2026-05-25T01:48:54+00:00

According to the accepted answer to this question GridView row height , if you…

  • 0

According to the accepted answer to this question GridView row height, if you…

“Set your LinearLayouts to be some specific height, and the rows will all be that height.”

This does not appear to work in my case. I have a layout file for each row as so:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" 
    android:layout_width="wrap_content"
    android:layout_height="200dp"
    android:layout_gravity="center_horizontal">

    <ImageView 
        android:id="@+id/theimage"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center_horizontal"
        android:background="#ffff0000" />

    <TextView 
        android:id="@+id/thename"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:layout_gravity="center_horizontal"
        android:gravity="center"
        style="?icontext" 
        android:background="#ff00ff00"/>

</LinearLayout>

And these are contained within a Gridview defined as so:

<GridView android:id="@+id/gridview" 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:numColumns="auto_fit" 
        android:columnWidth="100dp"
        android:background="@color/background" 
        android:verticalSpacing="1dp"
        android:horizontalSpacing="5dp" />

This ignores the ‘android:layout_height=”200dp”‘ and instead sets the row height to the cell’s content.

What’s worse is that when my TextView wraps onto a second line, that second line is obscured by the next row of cells.

What am I missing?

  • 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-25T01:48:55+00:00Added an answer on May 25, 2026 at 1:48 am

    The problem is solved in the following question: Layout problem with button margin

    android:layout_* attributes are LayoutParams and belong to the parent view. So they will be ignored if you don’t specify any parent.

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

Sidebar

Related Questions

Situation According to this accepted answer , if the " GC 'sees' a cyclic
This code is accepted by MSVC9.0. My question is whether it is legal according
I have not marked this question Answered yet. The current accepted answer got accepted
According to MSDN here and here (as well as the accepted answer to this
According to the answers to this question, I cannot embed a file version in
I've edited RouMao's solution into my code sample below. according to the accepted answer
According to the comments in the accepted answer here Rails how to Gzip Javascript?
According to this answer , namespace-scoped static variables were undeprecated in C++11. That is,
According to this discussion , the iphone agreement says that it doesn't allow loading
According to this article Silverlight 2 Beta 2 supports the DataContractJsonSerializer object. But, when

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.