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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:13:33+00:00 2026-06-12T02:13:33+00:00

I want to create 4 squares and in each square i want to create

  • 0

I want to create 4 squares and in each square i want to create a small button. The square must be visible and must have a border.

I know how to create 4 buttons as a square but i don’t know how to create a border around each square. But i want to to be size independent, now the buttons are very big…

my example

<?xml version="1.0" encoding="utf-8"?>
<ViewFlipper xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="fill_parent" android:layout_width="fill_parent">
    <RelativeLayout android:id="@+id/magaLoginLayout"
        android:layout_height="fill_parent" android:layout_width="fill_parent">
        <Button android:text="@+id/Button01" android:id="@+id/Button01"
            android:layout_width="160dip" android:layout_height="160dip" android:layout_marginTop="20dip"></Button>
        <Button android:text="@+id/Button03" android:layout_below="@+id/Button01" android:id="@+id/Button03"
            android:layout_alignLeft="@+id/Button01" android:layout_height="160dip" android:layout_width="160dip"></Button>
        <Button android:text="@+id/Button04" android:layout_below="@+id/Button01" android:id="@+id/Button04"
            android:layout_toRightOf="@+id/Button03" android:layout_height="160dip" android:layout_width="160dip"></Button>
        <Button android:text="@+id/Button02" android:id="@+id/Button02" android:layout_width="wrap_content"
            android:layout_toRightOf="@+id/Button01" android:layout_alignTop="@+id/Button01" android:layout_alignParentRight="true" android:layout_height="160dip"></Button>


</RelativeLayout>

enter image description here

  • 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-12T02:13:34+00:00Added an answer on June 12, 2026 at 2:13 am

    Do you want to create layout look like this screenshot ?

    This is layout for my apps named Call & Sms Blocker.

    Code for this layout :

    1. main_screen.xml

       <?xml version="1.0" encoding="utf-8"?>
        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:background="@drawable/bgimage2" >
      
         <TextView
           android:id="@+id/textView1"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:layout_alignParentTop="true"
           android:layout_centerHorizontal="true"
           android:layout_marginTop="29dp"
           android:text="Call & SMS Blocker" 
           android:textAppearance="?android:attr/textAppearanceLarge"
           android:textSize="40dp"
           android:textStyle="bold" /> 
      
        <Button 
         android:id="@+id/blocked_sms"
         android:layout_width="162dp" 
         android:layout_height="162dp"
         android:layout_marginLeft="50dp"
         android:layout_marginTop="120dp"
         android:background="@drawable/buttoneffects" 
         android:focusable="true" 
         android:textColor="#000000" 
         android:textStyle="bold" /> 
      
       <ImageButton
        android:id="@+id/imagebutton1" 
        style="?android:attr/buttonStyleSmall" 
        android:layout_width="50dp" 
        android:layout_height="50dp"
        android:layout_alignTop="@+id/blocked_sms" 
        android:layout_centerHorizontal="true" 
        android:layout_marginTop="136dp" 
        android:background="@drawable/buttoneffectpower" /> 
      
        <Button 
           android:id="@+id/blocked_calls"
           android:layout_width="162dp" 
           android:layout_height="162dp" 
           android:layout_alignBaseline="@+id/blocked_sms"
           android:layout_alignBottom="@+id/blocked_sms"
           android:layout_alignParentRight="true" 
           android:layout_marginRight="50dp"
           android:background="@drawable/buttoneffectssecond" 
           android:focusable="true" android:text="Blocked Calls"
           android:textColor="#000000" 
           android:textStyle="bold" /> 
      
        <Button 
           android:id="@+id/settings" 
           android:layout_width="162dp" 
           android:layout_height="162dp" 
           android:layout_alignLeft="@+id/blocked_calls"
           android:layout_below="@+id/imagebutton1" 
           android:layout_marginRight="50dp"
           android:background="@drawable/buttoneffectfourth" 
           android:focusable="true" android:text="Settings" 
           android:textColor="#000000" android:textStyle="bold" /> 
      
       <Button 
        android:id="@+id/blacklist" 
        android:layout_width="162dp" 
        android:layout_height="162dp" 
        android:layout_alignBaseline="@+id/settings"
         android:layout_alignBottom="@+id/settings" 
        android:layout_marginLeft="50dp" 
         android:layout_toLeftOf="@+id/imagebutton1"
        android:background="@drawable/buttoneffectthird" 
        android:focusable="true" 
        android:text="Blacklist" 
        android:textColor="#000000" 
        android:textStyle="bold" /> 
      
        <Button 
          android:id="@+id/help" 
          android:layout_width="150dp" 
          android:layout_height="70dp" 
          android:layout_alignLeft="@+id/blocked_sms"
       android:layout_alignParentBottom="true" 
       android:layout_marginBottom="69dp"
       android:background="@drawable/buttoneffectsimple" 
       android:focusable="true" 
       android:text="Help" 
       android:textColor="#000000" 
       android:textStyle="bold" /> 
      
         <Button 
        android:id="@+id/block_last_number" 
        android:layout_width="330dp" 
        android:layout_height="70dp" 
        android:layout_above="@+id/help" 
        android:layout_alignLeft="@+id/help" 
        android:layout_alignRight="@+id/settings" 
        android:layout_marginBottom="27dp"
        android:background="@drawable/buttoneffectsimple" 
        android:focusable="true" 
        android:text="Block Last Number" 
        android:textColor="#000000" 
        android:textStyle="bold" /> 
      
         <Button 
       android:id="@+id/aboutus" 
       android:layout_width="150dp" 
       android:layout_height="70dp" 
       android:layout_alignBaseline="@+id/help" 
       android:layout_alignBottom="@+id/help"
       android:layout_alignRight="@+id/block_last_number"
       android:background="@drawable/buttoneffectsimple" 
       android:focusable="true" 
       android:text="About Us" 
       android:textColor="#000000" 
       android:textStyle="bold" /> 
      
      </RelativeLayout>
      

    Code for button effects (xml files layout):

        <Selector>
            <item android:drawable="@drawable/blockedsms"><shape>
            <solid android:color="#fff" />
    
            <stroke android:width="1px" android:color="#444" />
    
            <corners android:radius="6dp" />
    
            <gradient android:angle="270" android:endColor="#10000000"
               android:startColor="#10FFFFFF" />
    
            <corners android:bottomRightRadius="50dp" />
        </shape></item>
    
           </selector>
    

    Now in other xml button effects layout, you have to change

          <corners android:bottomLeftRadius 
          <corners android:topRightRadius
          <corners android:topLeftRadius
    
          and so on......
    

    Hope! This will help.
    Cheers !!!

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

Sidebar

Related Questions

I want to create view with 52 square or button (for 52 week in
I have a grid of squares. Each square is either black or white. The
I want to create a non-stop spinning square using html and css. I currently
I want create an application with animate button? how can i do? after click
I want create a excel with Apache POI in java and I must insert
i want create image animation , i have 50 images with png format now
I want to create a play button that has a play image (triangle) and
I know there have been several posts already about Sudoku-related questions, but I am
Suppose I have an immutable NSArray and want to create several sub-arrays. I could
I have a 1-dimensional float array of root mean square values, each calculated with

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.