안드로이드 개발 질문/답변
(글 수 45,052)
안드로이드 공부를 시작한지 4일째 되는 학생입니다.
다름이 아니라 현재 '안드로이드 앱 개발 완벽 가이드' 책을 가지고 애니메이션 부분을 공부하고 있는데
현대 저를 답답하게 만들고 있는 부분이 바로화면 중심에 대한 문제점인데요.
원래 소스대로라면 위 동그란 이미지가 투명해졌다가 중앙 위로 올라가야 되는데 실행을 해보면
동그란 이미지가 투명해졌다가 오른쪽 위로 올라갑니다. 화면의 중심에 대해 문제점이 있는 것 같은데
어떻게 수정해야 될지 모르겠네요.
소스코드를 첨부하오니 확인 및 첨삭 부탁드리겠습니다. ㅜㅜ 감사합니다. ㅜㅜ
ApptestActivity.java
package com.owl.app; import android.app.Activity; import android.os.Bundle; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageView; public class ApptestActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.intro); ImageView image = (ImageView) findViewById(R.id.img_app_mark); Animation tween = AnimationUtils.loadAnimation(this, R.anim.tween); image.startAnimation(tween); } }
intro.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/bg" android:gravity="center" android:orientation="vertical" > <ImageView android:id="@+id/img_app_mark" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:drawingCacheQuality="high" android:src="@drawable/app_mark" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Android App-Site" android:gravity="center" android:textColor="#367b11" android:textSize="18px" android:textStyle="bold" android:typeface="sans" android:paddingTop="20px" android:paddingBottom="10px" android:shadowColor="#999999" android:shadowRadius="5" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Think of new generation\n새로운 생각을 하는 사람들" android:gravity="center" android:textColor="#e03001" android:textSize="12px" android:lineSpacingExtra="3px" android:textStyle="bold|normal" android:paddingBottom="30px" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="아울연구소(OWLAB) \n이두진 소장 / 연구원 : 이강우 \nhttp://www.owllab.com\nowl@owl.co.kr\n012-345-6789" android:gravity="center" android:textColor="#555555" android:textSize="11px" android:textStyle="normal|italic" android:lineSpacingExtra="0px" android:autoLink="all" android:layout_gravity="bottom" /> </LinearLayout>
tween.xml
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_decelerate_interpolator" > <alpha android:duration="1000" android:fromAlpha="0.0" android:interpolator="@anim/alpha_acc" android:toAlpha="1.0" /> <scale android:duration="1000" android:fromXScale="1.0" android:fromYScale="1.0" android:pivotX="50" android:pivotY="50%p" android:startOffset="2000" android:toXScale="2.0" android:toYScale="2.0" /> </set>