Mustafa Güven
Mustafa Güven

Reputation: 15744

How to set spinnerMode in codebehind

I could not find a way to set spinnerMode in codebehind. Spinner sets it's spinnerMode property automatically as dialog by default theme. How do I set it while I'm creating a new spinner on code behind?

Upvotes: 0

Views: 3895

Answers (3)

Izgah Freeman
Izgah Freeman

Reputation: 21

Spinner spinner = new Spinner(this.Context, SpinnerMode.Dialog); 

Upvotes: 2

ali safaei
ali safaei

Reputation: 131

in android >= 3.0 (API 11) you can use this :

Spinner spinner = new Spinner(this,null,android.R.style.Widget_Spinner,Spinner.MODE_DROPDOWN);

Upvotes: 3

slayton
slayton

Reputation: 20319

The answer is in the Android Spinner docs

Upvotes: 2

Related Questions