問題:
Android 螢幕的直向?橫向?
一、程式碼
Android 螢幕的直向?橫向?
一、程式碼
Activity.java
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); //強置為橫向 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); //強置為直向
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); //強置為橫向 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); //強置為直向
package tw.G000E004; import android.app.Activity; import android.os.Bundle; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageView; public class G000E004Activity extends Activity { Animation myanimation; ImageView img; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); myanimation=AnimationUtils.loadAnimation(this, R.anim.myanim); img=(ImageView)findViewById(R.id.img); img.startAnimation(myanimation); } }
android:fillafter="false"
android:fromxscale="0.0"
android:fromyscale="0.0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:pivotx="50%"
android:pivoty="50%"
android:toxscale="1.4"
android:toyscale="1.4">
android:fromxdelta="30"
android:fromydelta="30"
android:toxdelta="0"
android:toydelta="50">
android:fromdegrees="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:pivotx="50%"
android:pivoty="50%"
android:todegrees="+350">
android:layout_width="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">
android:layout_width="fill_parent"
android:text="@string/hello">
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/icon">