alpha 透明
在res/anim/aimi.xml
android:toYDelta="-100%p"
android:duration="300"/>
android:toAlpha="0.0"
android:duration="300"/>
final TextView tv = (TextView) findViewById(R.id.aimi);
Spinner spiner = (Spinner) findViewById(R.id.spinner1);
final String[] str = { "北京", "上海", "天津", "重庆" };
ArrayAdapter adapter = new ArrayAdapter(this,
android.R.layout.simple_spinner_item, str);
adapter.setDropDownViewResource(R.layout.textview);
spiner.setAdapter(adapter);
spiner.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView> arg0, View arg1,
int arg2, long arg3) {
tv.setText(str[arg2]);
}
@Override
public void onNothingSelected(AdapterView> arg0) {
// TODO Auto-generated method stub
}
});
final Animation anim = AnimationUtils.loadAnimation(this, R.anim.aimi);
spiner.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View arg0, MotionEvent arg1) {
arg0.startAnimation(anim); return false; } });