xml file code-
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/myLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.vishal.autoimage.MainActivity" > <ViewFlipper
android:id="@+id/flipper1"
android:layout_width="fill_parent"
android:layout_height="163dp"
android:paddingTop="55dp"
android:flipInterval="3000"
android:autoStart="true"
android:inAnimation="@android:anim/slide_in_left"
android:outAnimation="@android:anim/slide_out_right"
android:layout_centerInParent="true"
>
<ImageView
android:src="@drawable/image1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal" />
<ImageView
android:src="@drawable/image2"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal" />
<ImageView
android:src="@drawable/image3"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"/>
<ImageView
android:src="@drawable/image4"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"/>
<ImageView
android:src="@drawable/image5"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"/>
</ViewFlipper> </RelativeLayout>
java code- but no change java only change xml ok..
public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activi ty_main); } }
and last paste images.. drawable folder
कोई टिप्पणी नहीं:
एक टिप्पणी भेजें