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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:35:53+00:00 2026-06-06T02:35:53+00:00

i am designing an app for android tablets. I have created a layout file

  • 0

i am designing an app for android tablets. I have created a layout file which contains the application bar, next is some buttons. In the middle of the screen i want to have a horizontal scroll view inside which i need to show some images.

The number of images inside the scroll view depends upon the return data from the url. For this i am maintaining an array list. According to the size of the array i need to create the image views withing the scroll view.

I have placed all other buttons, textviews in the layout file and i need to make the above said view alone through coding, how to do this.

If the array size is 19, then the list of images within scroll view to be shown in the following order only

1  4  7  10  13  16  19
2  5  8  11  14  17    
3  6  9  12  15  18      

In iPad iBook apps library page, the books will be listed out in this way.

how to do this….

  • 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-06T02:35:54+00:00Added an answer on June 6, 2026 at 2:35 am

    Thanks to Dheeresh Singh

    Following is my main.xml file

    <HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
    
            <LinearLayout
                android:id="@+id/linear_1"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:orientation="horizontal" >
            </LinearLayout>
    </HorizontalScrollView>
    

    i have my Horizontal scroll view in my main.xml file

    public class LayoutActivity extends Activity 
    //implements OnClickListener
    {
        ViewGroup layout;
        LinearLayout lr;
    
        int x;
        int total = 4;
        int count = 0;
        LinearLayout lay;
    
        @Override
        public void onCreate(Bundle savedInstanceState) 
        {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            count = 0;
            layout = (ViewGroup)findViewById(R.id.linear_1);
            x = (total/3)+(total%3 > 0?1:0);;
            for(int i = 0; i < x; i++)
            {
                lr = new LinearLayout(this);
                lr.setOrientation(LinearLayout.VERTICAL);
                layout.addView(lr);
                for(int j = 0; j < 3; j++ )
                {
                    count++;
                    final View child = getLayoutInflater().inflate(R.layout.inflateview, null);
                    lay = (LinearLayout)child.findViewById(R.id.threeByThree_tableRow1_1_Layout1);
                    lay.setOnClickListener(new View.OnClickListener() 
                    {   
                        @Override
                        public void onClick(View v) 
                        {
                            Toast.makeText(getApplicationContext(), "selected  id  is "+child.getId(), Toast.LENGTH_SHORT).show();
                        }
                    });
                    lr.addView(child);
                    child.setId(count);
                    if(i == total)
                    {
                        break;
                    }
                }
            }      
        }
    }
    

    in the above code i have lr is the LinearLayout to display it in vertical order and View child is the data which i need to show in both vertical and horizontal order.

    Thanks a lot Dheeresh Singh

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

Sidebar

Related Questions

Myself designing an app which uses GPS and Maps. I have created the UI
I'm defining a style XML for my android app. I have some TTF files
I'm designing a MFC app in which I'd like to have a grid with
I'm designing an Android app which loads lots of small (say 128x128px@24-bit) PNG images
I am designing an Android app and I'm having a couple of layout issues.
We're designing an Android app that has several activities which are working in a
I am designing an app in xml android. I have been using lots of
I'm starting an Android app which will have multiple Activities. It will be using
I'm building the android application but I'm fed up while I'm designing my app
I'm currently designing an Android application, which will be published in Play for free.

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.