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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:57:25+00:00 2026-05-20T19:57:25+00:00

I displayed image and text in a gridview. i.e. Each item consists of one

  • 0

I displayed image and text in a gridview. i.e. Each item consists of one image and one text. It works fine. But I would like to know how to set the border of each gridview item separately in android.

  • 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-20T19:57:26+00:00Added an answer on May 20, 2026 at 7:57 pm

    1) create a attrs.xml under res>value folder.

    2) Add a resource :

    <declare-styleable name="Gallery1">
            <attr name="android:galleryItemBackground" />
     </declare-styleable>
    

    3) Add following code in your respective activity:

    TypedArray a = obtainStyledAttributes(R.styleable.Gallery1);
    int mGalleryItemBackground = a.getResourceId(
                        R.styleable.Gallery1_android_galleryItemBackground, 0);
    a.recycle();
    

    4) then set the mGalleryItemBackground as the background of your view. You will get a border outside your view.
    For example:

    imageView.setBackgroundResource(mGalleryItemBackground);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like the image to be displayed inside a table. At the moment
Especially each image that contains the text and icon are displayed using background-image in
I have created a XML image gallery, which displays text in between each slide.
I want to get the currently selected item (text, image, etc) and display in
We would like to display text and images of an web page in higher
I have large images displayed in a grouped tableview. I would like the images
I am fetching Image and Text for GridView from a webservice, so its takes
I want to display some text below each grid image. Please see my code
I am new to javascript and would like to have an image that is
I add a ButtonField in one Gridview's Column so there is Buttonfield for each

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.