Tuesday, April 8, 2014

Spinner used android friends, have come to help us to see the pictures.


I do an android software, which used a spinner drop-down control.

Why do people use the spinner to the right is an inverted triangle ,


And I was

In the end what is the problem? Hope this problem encountered friends, to the point tips.

java code is as follows:

package com.example.b;

import com.example.b.R;

import android.os.Bundle;
import android.app.Activity;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

public class MainActivity extends Activity {

private static final String [] mCountries = {"China1", "China2", "China3", "China4", "China5", "China6"};

@ Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.activity_main);

Spinner sp1 = (Spinner) findViewById (R.id.spinner1);

ArrayAdapter ad = new ArrayAdapter (this, android.R.layout.simple_spinner_item, mCountries);
ad.setDropDownViewResource (android.R.layout.simple_spinner_dropdown_item);
sp1.setAdapter (ad);
}


}

xml code is as follows:
xmlns: tools = "http://schemas.android.com/tools"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: paddingBottom = "@ dimen / activity_vertical_margin"
android: paddingLeft = "@ dimen / activity_horizontal_margin"
android: paddingRight = "@ dimen / activity_horizontal_margin"
android: paddingTop = "@ dimen / activity_vertical_margin"
tools: context = ". MainActivity">

android: id = "@ + id/spinner1"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
style = "@ android: attr / spinnerDropDownItemStyle" />




ps: I know "style =" @ android: attr / spinnerDropDownItemStyle "/" is set spinner style, but, in my place, there are no words, style are unchanged.
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
If someone else's style down 30 cents is not a system, then probably custom styles
Reply:
cited a floor Roy_se7en reply:
if someone else's style down 30 cents is not a system, then probably custom styles


According to what you mean, I was not the first system to check the style spinner, ah,
Where the investigation ah?
Reply:
reference to the second floor reloveed reply:
Quote: references to a floor Roy_se7en reply:

If someone else's style down 30 cents is not a system, then probably custom styles


According to what you mean, I was not the first system to check the style spinner, ah,
Where the investigation ah?

In style.xml, and did not indicate that the system default style. Not studied whether there are other systems styles.
You see someone pour 3 corner is where to look. Look what style it is used?
Reply:
Previous Spinner is this inverted triangle style. 4.0 will be replaced later this style of you.
Want ago that you can customize Spinner.
Reply:
Thank you upstairs reply, but I checked style.xml file, as follows,
No spinner style settings.
Fair to say that there is a triangular pattern, it should be the default style, but also add my own look? ?




<-!
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res / values-vXX / styles.xml on newer devices.
->


<-! Application theme -.>