我通过网络服务解析数据。我想要水平翻转而不是垂直翻转。这里是一个教程,其中使用ViewFlipper,但它是用于静态数据。如何在Android中制作动态翻转屏幕(如iPhone)
这里是我们的代码,我们需要2个活动之间翻转:
Splash.java
public class Splash extends Activity{
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
startActivity(new Intent(Splash.this, MainMenu.class));
Splash.this.finish();
}
}
Splash.xml
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/splash">
</AbsoluteLayout>
Menu.java
public class Menu extends Activity{
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.menu);
}
}
menu.xml文件
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/menu">
</AbsoluteLayout>
你是什么意思“这是第一个使用ViewFlipper教程”? – 2011-12-20 14:17:56
检查这个[答案](http://stackoverflow.com/questions/2651360/how-to-provide-animation-when-calling-another-activity-in-android/2651890#2651890) – Praveen 2010-04-19 13:59:44