2012-09-25 2 views
1

나는 뒤집기 UI 스크린을 개발하고 있습니다. "android.view.animation.Animation"클래스를 사용하여 을 onClick에 적용했지만 작동하지 않습니다 ontouch에서는 작동하지 않습니다. 내 코드android 애니메이션이 onTouch에서 작동하지 않습니다

onTouch에서
Animation cardTwoAnimation = cardTwoAnimation = new RotateAnimation(-100f, -180f, 
Animation.RELATIVE_TO_SELF, 0.5f, Animation.ABSOLUTE, 1); 

cardTwoAnimation.setDuration(1000); 
cardTwoAnimation.setRepeatCount(0); 
cardTwoAnimation.setRepeatMode(Animation.ZORDER_TOP); 
cardTwoAnimation.setFillAfter(true); 
fmbCardLayoutTwo.setAnimation(cardTwoAnimation); 

제가 그 레이아웃을 회전 시키도록 동일한 방법을 사용하고, 상대 레이아웃 안에 3 개 개의 선형 레이아웃 있는데, onTouch 방법 호출 그러나 문제는 (화면의 애니메이션 표시되지 않는 모든 system.out 문이 한 줄씩 실행 중임)

<RelativeLayout 
      android:id="@+id/fmb_asker_questions_relative_layout" 
      android:layout_width="wrap_content" 
      android:layout_height="170dp" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentTop="true" 
      android:clickable="true" > 

      <LinearLayout 
       android:id="@+id/question_card_two_linear_layout" 
       android:layout_width="110dp" 
       android:layout_height="150dp"   
       android:layout_marginBottom="196dp" 
       android:layout_marginLeft="90dp" 
       android:layout_marginTop="160dp" 
       android:background="@drawable/fmb_asker_card_style" 
       android:orientation="vertical" >        

      </LinearLayout> 

      <LinearLayout 
       android:id="@+id/question_card_one_linear_layout" 
       android:layout_width="110dp" 
       android:layout_height="150dp" 
       android:layout_alignParentBottom="true" 
       android:layout_marginBottom="196dp" 
       android:layout_marginLeft="90dp" 
       android:layout_marginTop="160dp" 
       android:background="@drawable/fmb_asker_card_style" 
       android:clickable="true" 
       android:orientation="vertical" >    

      </LinearLayout> 

      <LinearLayout 
       android:id="@+id/question_card_three_linear_layout" 
       android:layout_width="110dp" 
       android:layout_height="150dp" 
       android:layout_alignParentBottom="true" 
       android:layout_marginBottom="196dp" 
       android:layout_marginLeft="90dp" 
       android:layout_marginTop="160dp" 
       android:background="@drawable/fmb_asker_card_style" 
       android:orientation="vertical" > 

      </LinearLayout> 

      <LinearLayout 
       android:id="@+id/fmb_ascker_question_card_submit_button" 
       android:layout_width="110dp" 
       android:layout_height="120dp" 
       android:layout_alignParentBottom="true" 
       android:layout_marginBottom="196dp" 
       android:layout_marginLeft="90dp" 
       android:layout_marginTop="100dp" 
       android:background="@drawable/fmb_asker_fliping_submit_button_style" 
       android:orientation="vertical" > 

       <TextView 
        android:id="@+id/textView1" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_marginLeft="10dp" 
        android:layout_marginTop="25dp" 
        android:text="SELECT" 
        android:textSize="20dp" 
        android:textColor="#ffffff" 
        android:textStyle="bold" /> 
      </LinearLayout> 

      <Button 
       android:id="@+id/button_right" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentRight="true" 
       android:layout_marginRight="15dp" 
       android:text="Right" /> 

      <Button 
       android:id="@+id/button_left" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignBaseline="@+id/button_right" 
       android:layout_alignBottom="@+id/button_right" 
       android:layout_alignLeft="@+id/layout2" 
       android:text="Left" /> 
     </RelativeLayout> 

답변

0

RelativeLayout 대신 LinearLayout을 사용해보십시오.

관련 문제