我正在通过 Web 服务解析数据。我想要水平翻转而不是垂直翻转。这是一个使用 ViewFlipper 的教程,但它是针对静态数据的。
这是我们需要在 2 个活动之间切换的代码:
飞溅.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();
}
}
飞溅.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>
菜单.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);
}
}
菜单.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>