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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:02:15+00:00 2026-05-22T19:02:15+00:00

I’m not sure where to start with this, I’ve been building an app over

  • 0

I’m not sure where to start with this, I’ve been building an app over the last week and have made good progress and need a custom view now. I’ve looked at http://developer.android.com/guide/topics/ui/custom-components.html.
but huh…not sure how to piece it together.
I want to position the number picker to the left and some text and an image to the right and be able to listen for clicks on the number picker… To be honest I’m not sure where to start.

  • 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-05-22T19:02:16+00:00Added an answer on May 22, 2026 at 7:02 pm

    I would use a layout to combine your Components. Define your layout in xml:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:orientation="horizontal">
           <NumberPicker
            android:id="@+id/picker"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="1dip"
            android:layout_marginRight="1dip"
            />
           <ImageView 
           android:id="@+id/image"
           android:layout_toRightOf="@id/picker"
           android:src="..."
           android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="1dip"
            android:layout_marginRight="1dip"
           />
          <TextView 
           android:id="@+id/text"
           android:text="some text"
           android:layout_toRightOf="@id/image"
           android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="1dip"
            android:layout_marginRight="1dip"
           />
    </RelativeLayout>
    

    To use this layout as the rows of a list: create a custom list adapter that extends BaseAdapter, set your list adapter to your custom list adapter, and Override the getView method of the adapter with the below:

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
    
        View view = null;
    
        //if convertView is null, inflate a view.
        //otherwise reuse the convertView   
        if(convertView == null)
        {
            view = mInflater.inflate(R.layout.filebrowserrow, null);
        }
        else
        {
            view = convertView;
        }
    
        //retrieve picker to set listeners, initialize values, etc  
        NumberPicker picker = (NumberPicker)view.findViewById(R.id.picker);
    
        //retrieve ImageView to change image, etc   
        ImageView image = (ImageView)view.findViewById(R.id.image);
    
        //retrieve TextView to change text, etc 
        TextView text = (TextView)view.findViewById(R.id.text);     
    
        return view;
    

    }

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text

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.