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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:20:47+00:00 2026-06-06T14:20:47+00:00

I am using the <shape> tag like this: <?xml version=1.0 encoding=UTF-8?> <shape xmlns:android=http://schemas.android.com/apk/res/android> <solid

  • 0

I am using the <shape> tag like this:

<?xml version="1.0" encoding="UTF-8"?>
  <shape xmlns:android="http://schemas.android.com/apk/res/android">
  <solid android:color="#00FFFFFF" />
  <stroke android:width="1dp" android:color="#FFFFFFFF" />
  <padding android:left="1dp" android:top="1dp" android:right="1dp"
    android:bottom="1dp" />
</shape>

I have a lot of views I created with the <shape> tag in a GridView and I need to change the part that was set here:

<solid android:color="#00FFFFFF" />

and set another color, but I don’t know how…
I tried to use ImageView.Adapter like this:

imageView = new ImageView(context);
        imageView.setLayoutParams(new GridView.LayoutParams(160, 105));
        imageView.setBackgroundColor(myBackgroundColors[position]);
        imageView.setBackgroundResource(R.drawable.border);

I set the background color before I call setBackgroundResource() and in XML I use transparent color, but it doesn’t work…any ideas?

  • 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-06T14:20:48+00:00Added an answer on June 6, 2026 at 2:20 pm

    When using the <shape /> (Shape Drawable) tag in xml the compiled resource is not an imageview; it compiles into a GradientDrawable. The <solid /> tag defines a solid color to fill the defined shape and sets it as android:color. Thus, to change this programatically you should use the setColor() method.

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

Sidebar

Related Questions

This code draws a single color (with alpha) shape using a bitmap's alpha channel.
How would I best implement these? I thought of something like this: using namespace
Ok So I looked at this: Using jQuery to extract CDATA in XML for
Is it possible to create the curved sail shape below using HTML and CSS
I am using the code below to change to shape of the winform. It's
I jave a Javascript code that draws a shape with specific color using style.backgroundColor=.
I really appreciate if someone can help me with using how to use shape
I am using the HTML canvas tag to draw around 3000, vector lines on
I've implemented a web based instant messaging / chat feature using http binding and
im using the following code to share content on facebook- <a href=https://www.facebook.com/dialog/feed?app_id=325675344144789&link=<?=$station_info->link?>& picture=<?=$station_info->img_url?>& name=<?=$station_info->title?>&

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.