Customize Spinner

by Ajay » Wed, 21 Apr 2010 18:47:55 GMT


Sponsored Links
 Hi,
   I want to customize the spinner behavior a little bit. I want to
add a couple of buttons at the end of the drop down menu that is
displayed when the user selects the control. Any idea how this could
be done?

Thank you,
AJ

--



Customize Spinner

by Tim » Wed, 21 Apr 2010 19:03:40 GMT


 


Clone the spinner code in your project, then modify it.

By the way, why is the drop-down widget called Spinner, and the
spinner widget called NumberPicker? Confusing!

--


Sponsored Links


Customize Spinner

by Ajay » Wed, 21 Apr 2010 20:36:10 GMT


 Is there a simpler way or standard widget that I could use?

Thank you,
AJ





>



Customize Spinner

by Mark Murphy » Wed, 21 Apr 2010 20:43:31 GMT


 


Write your own Dialog (or a Dialog-themed Activity) to look how you
want. Make a "Spinner" out of TextViews and ImageButtons. When they
click the ImageButton, display the Dialog or Activity for the user
interaction.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

_The Busy Coder's Guide to Android Development_ Version 3.0
Available!

--



Other Threads

1. How to create TextView without write the XML file

As a newbie, I have been reading posts in learning how to do different
functions.  Using the Hello World example, I added a textview object
to this application but the results come back as false on the screen.
Here's my code:

main.xml:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
        <Button android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Click Me"
android:layout_centerInParent="true"></Button>
        <TextView android:text="@+id/TextView01" android:id="@+id/TextView01"
android:layout_below="@id/Button01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"></TextView>
</RelativeLayout>
---------------------------------------------------------------------------------------------------------------------------------
Hello.java

package com.HelloWorld;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class Hello extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        // start code here
        TextView tv = new TextView(this);
        tv.setText("This is sample.");
        Button button = (Button) findViewById(R.id.Button01);
        button.setOnClickListener(new OnClickListener() {
                        public void onClick(View v) {
                                // TODO Auto-generated method stub
                                Toast.makeText(Hello.this, "Hello World",
Toast.LENGTH_SHORT).show();

                        }
        });
    }
}

---------------------------------------------------------------------------------------------------------------------------------
Note that the example included a clickable button which has a popup to
say "Hello World".  That works just fine, but setting the text in the
TextView comes out as false.  Originally I wanted to click on the
button and present the results in a TextView, but I was unable to do
that unless someone can shed some light on that.

Any suggestions on why I am getting the "false" reading and if anyone
can suggest on how to place the results in a TextView via a button
click, that would be appreciated.

-- 

2. Android preprocessor, //#ifdef...

Hi all,
I noticed that there is no way to use preprocessor in android with
netbeans using the
//#ifdef syntax,

is there some sort of preprocessing in eclipse using android?
I haven't understood if this is a lack of netbeans or it is a lack of
android.

-- 

3. Understanding Horizontal Scrollview and relationship to bitmap

4. what member variable in Activity class stores its state?

5. Where can i get the an updated version gdbserver for armv7-a-neon.mk

6. Help with simple Bitmap issue

7. start emulator with ant