我有一个包含 ViewFlipper 的 XMl 文件,并希望在 3 秒后显示下一个视图(在 viewflipper 中),但在此期间之后不显示:XML:
<?xml version="1.0" encoding="UTF-8"?>
<ViewFlipper xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/flipper" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/sipLabel" android:textSize="20sp"
android:layout_width="fill_parent" android:layout_height="wrap_content" />
<ImageView android:id="@+id/disconnected" android:src="@drawable/disconnected"
android:layout_below="@id/sipLabel" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="0.35"
android:gravity="center" android:visibility="visible" />
</RelativeLayout>
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/sipLabel" android:textSize="20sp"
android:layout_width="fill_parent" android:layout_height="wrap_content" />
<ImageView android:id="@+id/connected" android:src="@drawable/connected"
android:layout_below="@id/sipLabel" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="0.35"
android:gravity="center" android:visibility="visible" />
</RelativeLayout>
</ViewFlipper>
JAVA代码:
public void onRegistrationDone(String localProfileUri, long expiryTime)
{
updateStatus("Registered to server.");
Log.d("SUCCEED", "Registration DONE");
final ViewFlipper flipper = (ViewFlipper) findViewById(R.id.flipper);
flipper.postDelayed(new Runnable()
{
public void run()
{
flipper.showNext();
}
}, 3000);
}
问题是什么 ?为什么下一个视图不显示?
谢谢您的帮助。