i看看!!

 

1.

ga.setOnItemSelectedListener(new OnItemSelectedListener()
  {

   @Override
   public void onItemSelected(AdapterView<?> arg0, View arg1,
     int arg2, long arg3)
   {
    gaAdapter.setSeclect(arg2);
    gaAdapter.notifyDataSetChanged();
   }

   @Override
   public void onNothingSelected(AdapterView<?> arg0)
   {

   }
  });

.............

if (position == mIndex /* mGa.getSelectedItemId() */)
   {
    i.setBackgroundResource(R.drawable.icon);
   } else
   {
    i.setBackgroundColor(0x00000000);
   }

2.<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="0"
android:toXDelta="0"
android:fromYDelta="-60"
android:toYDelta="0"
android:duration="500"
/>
<!-- translate 位置转移动画效果
        整型值:
        fromXDelta 属性为动画起始时 X坐标上的位置   
        toXDelta   属性为动画结束时 X坐标上的位置
       
        fromYDelta 属性为动画起始时 Y坐标上的位置
        toYDelta   属性为动画结束时 Y坐标上的位置
        注意:
                     没有指定fromXType toXType fromYType toYType 时候,默认是以自己为相对参照物
                  
       
        长整型值:
        duration  属性为动画持续时间
        说明:    
                     时间以毫秒为单位
-->
</set>

 

<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false"
>
    <alpha
        android:interpolator="@android :res/anim/accelerate_decelerate_interpolator"
        android:fromAlpha="0.0"
        android:toAlpha="1.0"
        android:duration="500"
        android:repeatCount="0"

    >
    </alpha>
   
    <translate
        android:fromXDelta="0"
        android:toXDelta="0"
        android:fromYDelta="-60"
        android:toYDelta="0"
        android:duration="500"
        />
       
</set>

.........

 private void load_start_Animation(int i) {

  Animation animation = AnimationUtils.loadAnimation(this, R.anim.alpha_translate);
   button_toTestAnimation.startAnimation(animation);
   Animation animation2 = AnimationUtils.loadAnimation(this, R.anim.my_translate_action);
   button02.startAnimation(animation2);
 }

 http://www.iteye.com/topic/1116284

http://blog.csdn.net/floodingfire/article/details/8144604

 

你可能感兴趣的:(i看看!!)