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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:02:27+00:00 2026-06-10T22:02:27+00:00

I am making a project where I need to make a customised spinner where

  • 0

I am making a project where I need to make a customised spinner where each option consists of an image view and a text box. I am new in Android. Any idea? A sample code will be of great help. Thank you.

  • 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-10T22:02:29+00:00Added an answer on June 10, 2026 at 10:02 pm

    Yes, you can do like use of Custom Adapter

    test.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:orientation="horizontal">
    
        <ImageView
         android:id="@+id/icon"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:src="@drawable/icon"
         android:layout_marginLeft="15dip" />
    
        <TextView 
         android:id="@+id/weekofday"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginLeft="5dip" 
         android:layout_marginTop="10dip"
         android:text="Sunday"
         android:textColor="#000000"/>
    
    </LinearLayout>
    

    CustomSpinner.java

    public class CustomSpinner extends Activity {
    
        String[] DayOfWeek = {"Sunday", "Monday", "Tuesday", 
                "Wednesday", "Thursday", "Friday", "Saturday"};
    
        Integer[] image = {
                    R.drawable.image1,
                    R.drawable.image2,
                    R.drawable.image3,
                    R.drawable.image4,
                    R.drawable.image5,
                    R.drawable.image6,
                    R.drawable.image7 };
    
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main1);
    
            Spinner mySpinner = (Spinner)findViewById(R.id.spinner);
            mySpinner.setAdapter(new MyCustomAdapter(CustomSpinner.this, R.layout.test, DayOfWeek,image)); 
        }
    
        public class MyCustomAdapter extends ArrayAdapter<String>{
    
            public MyCustomAdapter(Context context, int textViewResourceId,
                    String[] objects, Integer[] image) {
                super(context, textViewResourceId, objects);
                // TODO Auto-generated constructor stub
            }
    
            @Override
            public View getDropDownView(int position, View convertView,
                    ViewGroup parent) {
                // TODO Auto-generated method stub
                return getCustomView(position, convertView, parent);
            }
    
            @Override
            public View getView(int position, View convertView, ViewGroup parent) {
                // TODO Auto-generated method stub
                return getCustomView(position, convertView, parent);
            }
    
            public View getCustomView(int position, View convertView, ViewGroup parent) {
                // TODO Auto-generated method stub
                //return super.getView(position, convertView, parent);
    
                LayoutInflater inflater=getLayoutInflater();
                View row=inflater.inflate(R.layout.test, parent, false);
                TextView label=(TextView)row.findViewById(R.id.weekofday);
                label.setText(DayOfWeek[position]);
    
                ImageView icon=(ImageView)row.findViewById(R.id.icon);
                icon.setImageResource(image[position]);
                return row;
            }    
        }
    }
    

    Place some images in your drawable folders. Have a look at Here Also this

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

Sidebar

Related Questions

I have this school project I'm making, where I need to make my code
For a new project, I need to make an scroable lightbox like one that
I'm making a program that uses text files. I need to make it so
I am making a game in php as a personal project. I can make
I'm working in a android project the idea is simple: I just need to
I need to make some Python applications for a work project. The target platform
Hi i'm thinking about making midi step sequencer and I need to make a
I am making a new graphical menu interface for a project I am making.
I have a very large ASP.NET project that i need to make good with
For a school project, I need to make a simple paint application that can

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.