Tôi đang làm như thế này nó đang tải tĩnh những hình ảnh này?Làm thế nào để thiết lập hình ảnh động để ViewFlipper trong Android?
public class ArchiveGroup extends Activity {
Button btn;
ViewFlipper flip;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.next);
btn=(Button)findViewById(R.id.btn);
flip=(ViewFlipper)findViewById(R.id.flip);
}
public void ClickHandler(View v)
{
flip.showNext();
}
public void ClickHandler1(View v)
{
Toast.makeText(this,"text",Toast.LENGTH_LONG).show();
}
}
tôi đang sử dụng ba ImageView trong ViewFlipper trong xml
tập tin
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Flip"
android:id="@+id/btn"
android:onClick="ClickHandler"
/>
<ViewFlipper
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/flip"
>
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher"
/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher"
/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher"
/>
</ViewFlipper>
</LinearLayout>
Làm thế nào để thiết lập hình ảnh động để những IMAGExem. Bằng cách sử dụng một ImageView.
+1 điều này rất hữu ích cho tôi. – Praveenkumar