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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:14:38+00:00 2026-06-15T08:14:38+00:00

I would like to design a chess board, but by including 8 times another

  • 0

I would like to design a chess board, but by including 8 times another layout containing 8 ImageView. Then, how can I have unique android:id for all 64 squares components ?

I would like the included layout to be designed as this :

LinearLayout (orientation : horizontal)
-> ImageView
-> …
-> ImageView

Another point, is having LinearLayout for the parent and the included layout the best performance technique ? I thought of using RelativeLayout, but I don’t see how I can manage.

  • 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-15T08:14:39+00:00Added an answer on June 15, 2026 at 8:14 am

    I would go with a TableLayout as Code Guru mentioned here is sample code that will help you to create the chess board you are looking for

    <?xml version="1.0" encoding="utf-8"?>
        <TableLayout 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:gravity="center_horizontal"
        android:background="#FFFFFF" >
    
        <TableRow
            android:id="@+id/tableRow1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" >
    
            <ImageView
                android:id="@+id/block1"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image1 />
    
            <ImageView
                android:id="@+id/block2"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image2 />
    
            <ImageView
                android:id="@+id/block3"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image1 />
    
            <ImageView
                android:id="@+id/block4"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image2 />
    
            <ImageView
                android:id="@+id/block5"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image1 />
    
          <ImageView
                android:id="@+id/block6"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image2 />
    
        <ImageView
                android:id="@+id/block7"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image1 />
    
      <ImageView
                android:id="@+id/block8"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image2 />
        </TableRow>
    
    <TableRow
            android:id="@+id/tableRow2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" >
    
            <ImageView
                android:id="@+id/block9"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image1 />
    
            <ImageView
                android:id="@+id/block10"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image2 />
    
            <ImageView
                android:id="@+id/block11"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image1 />
    
            <ImageView
                android:id="@+id/block12"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image2 />
    
            <ImageView
                android:id="@+id/block13"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image1 />
    
          <ImageView
                android:id="@+id/block14"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image2 />
    
        <ImageView
                android:id="@+id/block15"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image1 />
    
      <ImageView
                android:id="@+id/block16"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/image2 />
        </TableRow>
    

    And so on and so forth…you could if you wanted to use a white and black background color alternatively instead of an image.

    hope this helps!

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

Sidebar

Related Questions

I have an UserControl and would like to hide the resizing handles in design-time,
I have to design a GUI using Qt. I would like to draw multiple
I have this design which I cannot seem to get right, I would like
I would like to design a web page Gui where users can design a
I would like to design a family tree on my website. How can this
I would like to design a simple application (without j2ee and jms) that can
I would like to design 2 modules A and B which both have their
We have a design like below and I would like to get opinions or
I have a site build in Sharepoint 2007 WSS.I would like design code from
I would like to design a C# application to store emlployees data, I have

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.