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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:40:39+00:00 2026-06-03T06:40:39+00:00

How can i wrap elements in the XML code in a box like view?

  • 0

How can i wrap elements in the XML code in a box like view? meaning that i want them to be looking like they are grouped in some box with borders.

<Button
    android:id="@+id/carbgraph"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_x="230dp"
    android:layout_y="378dp"
    android:text="Button" />

<ProgressBar
    android:id="@+id/progressBarforcals"
    style="?android:attr/progressBarStyleHorizontal"
    android:layout_width="280dp"
    android:layout_height="wrap_content"
    android:layout_x="15dp"
    android:layout_y="346dp" />

<TextView
    android:id="@+id/calsinmenu"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_x="16dp"
    android:layout_y="320dp"
    android:text="TextView" />
  • 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-03T06:40:41+00:00Added an answer on June 3, 2026 at 6:40 am

    Put your widgets in a layout (LinearLayout for example) and edit this layout background as below:

    <LinearLayout 
       ...
       android:background="@drawable/background"
    </LinearLayout>
    

    Then create an XML file in your drawable folder named background.xml:

    <shape xmlns:android="http://schemas.android.com/apk/res/android">
        <stroke 
            android:width="3dp" 
            android:color="#838c7f">
        </stroke>
    
        <padding 
            android:left="3dp" 
            android:top="3dp"
        android:right="3dp" 
        android:bottom="3dp">
        </padding>
    
        <corners android:radius="4dp" />
    
        <gradient 
            android:startColor="@color/background_start" 
            android:endColor="@color/background_end"/>
    </shape>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to write a delegate function that can 'wrap' some while/try/catch code around
I would like to have a function that can wrap any other function call.
I have some XML with <ListItem> elements, and I'd like to wrap any consecutive
How can I write a wrapper that can wrap any function and can be
I'm trying to build a rectangular grid that can wrap around at the edges.
I would like to define my own view class that consists of several Textviews,
In my code i'm using and XML file for showing a view in Android.
I'd like to use jQuery.clone() but I only want to copy the inner elements,
In LinearLayout we can populate elements horizontally by using Layout_Weight which makes them occupy
Given two ordered but not necessarily sequential sibling elements, how can I wrap html

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.