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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:56:29+00:00 2026-05-21T11:56:29+00:00

I have activity with three GrindViews. I fill these views with custom SimpleCursorAdapters. In

  • 0

I have activity with three GrindViews. I fill these views with custom SimpleCursorAdapters. In each cell is button which I need to be stretched into that cell of GrindView. And also I need that there will be no free space between that GrindViews. I already try to set padding/margin with no effect. Here are the XMLs:

MainView:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">

<GridView android:id="@+id/gridview1" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:numColumns="5"
    android:gravity="center" />

<GridView android:id="@+id/gridview2" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:numColumns="5"
    android:gravity="center" />

<GridView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/gridview3" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:numColumns="4"
    android:gravity="center" />

Cell:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:padding="1dip"
android:layout_height="fill_parent" android:orientation="horizontal">

<Button xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:padding="1dip"
    android:layout_height="fill_parent" android:id="@+id/textButton" />

Screenshot:
Current Status

Thanks for any 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-21T11:56:30+00:00Added an answer on May 21, 2026 at 11:56 am

    I think you’ll have to set your own drawable image for your buttons, and not use the standard system image. Unless I’m mistaken, the standard MDPI image for buttons has a built in transparent border of 3 pixels on the horizontal sides, 1 pixel on the top side, and 4 pixels on the bottom side. So, even if this button image were fully expanded to 100% fill a grid cell, it would still include this transparent border, and thus not appear to fully fill the cell. (This is based on the assumption that the default button image is btn_default_normal.9.png.)

    Instead of using Buttons, take a look at ImageButton, which allows you to set your own image. Or, to use the regular Button, you may need to set the button’s background image with a state list drawable. Take a look at the “Button style” section for more information.

    —

    However, I do see now in the docs, “Explicitly setting a padding value will override the corresponding padding found in the background.” I see you mentioned you tried setting the padding, but did you try setting the padding to zero?

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

Sidebar

Related Questions

I have an activity with three listviews, each having three different cursors, but all
I have three tabs and each one is its own activity. When I switch
I have an activity that has a TabHost containing a set of TabSpecs each
I have a need to do auditing all database activity regardless of whether it
I have a couple of tables which are used to log user activity for
I have three activities, A, B and C. User can start activity B from
i have a input tag which is non editable, but some times i need
i have created a workflow activity that do give the item creater of a
I have a web-based application that notifies users of activity on the site via
Have just started using Visual Studio Professional's built-in unit testing features, which as I

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.