Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone


ImageSwitcher - Android Widgets Example

ImageSwitcher - Android Widgets สำหรับ ImageSwitcher เป็น Widget ใช้สำหรับแสดงรูปภาพ (ImageView) หรือควบคุมการปรับเปลี่ยนรูปภาพในรูปแบบต่าง ๆ โดยใน ImageSwitcher สามารถใส่ Effect ให้กับรูปภาพได้ เช่นในกรณีที่เปลี่ยนรูปภาพสามารถทำเป็น Fade In หรือ Fade Out ได้ ซึ่ง ImageSwitcher สามารถทำงานร่วมกับ Widgets Gallery เพื่อแสดงรุปภาพก่อนแล้วค่อยนำภาพที่ได้จากการเลือกมาแสดงใน ImageSwitcher

ImageSwitcher - Android Widgets

XML Syntax
1.<ImageSwitcher
2.    android:id="@+id/imageSwitcher1"
3.    android:layout_width="wrap_content"
4.    android:layout_height="wrap_content" />

Example 1 การใช้ ImageSwitcher ควบคุมการเปลี่ยนแปลงรูปภาพ ImageView แบบง่าย ๆ

ImageSwitcher - Android Widgets

ออกแบบหน้าจอ GraphicLayout ด้วย Widget ตามรูป

activity_main.xml (XML Layout)
01.<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
02.    xmlns:tools="http://schemas.android.com/tools"
03.    android:layout_width="match_parent"
04.    android:layout_height="match_parent" >
05.            
06.         <LinearLayout
07.            android:id="@+id/LinearLayout01"
08.            android:layout_width="wrap_content"
09.            android:layout_height="wrap_content"
10.            android:layout_centerHorizontal="true"
11.            android:layout_marginTop="75dp" >
12.                    <ImageSwitcher
13.                    android:id="@+id/imageSwitcher1"
14.                    android:layout_width="wrap_content"
15.                    android:layout_height="wrap_content"
16.                    android:layout_marginTop="100dp" >
17.                     
18.                        <ImageView
19.                        android:id="@+id/imageView1"
20.                        android:layout_width="wrap_content"
21.                        android:layout_height="wrap_content"
22.                        android:src="@drawable/pic_a" />
23.                        <ImageView
24.                        android:id="@+id/imageView2"
25.                        android:layout_width="wrap_content"
26.                        android:layout_height="wrap_content"
27.                        android:src="@drawable/pic_b" />     
28.                                 
29.                    </ImageSwitcher>
30.        </LinearLayout>
31.     
32.             
33.</RelativeLayout>


XML Layout กับ ImageSwitcher

ImageSwitcher - Android Widgets

จาก XML Layout จะเห็นว่ามีการใช้ ImageSwitcher เพื่อควบคุม ImageView อยู่ 2 ตัว (กรณีแสดงผลจาก XML Layout จะสามารถกำหนดได้แค่ 2 ตัว)


MainActivity.java (Java Code)
01.package com.myapp;
02. 
03.import android.app.Activity;
04.import android.os.Bundle;
05.import android.view.Menu;
06.import android.view.View;
07.import android.widget.ImageSwitcher;
08. 
09.public class MainActivity extends Activity {
10. 
11.    ImageSwitcher ImS;
12.     
13.    public void onCreate(Bundle savedInstanceState) {
14.        super.onCreate(savedInstanceState);
15.        setContentView(R.layout.activity_main);
16.         
17.        ImS = (ImageSwitcher) findViewById(R.id.imageSwitcher1);
18.        ImS.setOnClickListener(new View.OnClickListener() {
19.           public void onClick(View v) { 
20.              ImS.showNext();
21.            }   
22.        }); 
23.      
24.    
25. 
26.    @Override
27.    public boolean onCreateOptionsMenu(Menu menu) {
28.        getMenuInflater().inflate(R.menu.activity_main, menu);
29.        return true;
30.    }
31.     
32.}


จาก Code ของ Java จะเห็นว่า ImageSwitcher มี Property ชื่อว่า showNext(); เพื่อแสดงรูปถัดไป ซึ่งจะสลับไปสลับมา

กรณีที่ต้องการใส่ Effect สามารถเพิ่มได้ตรง

1.Animation inAnim = new AlphaAnimation(0, 1);
2.inAnim.setDuration(2000);
3.Animation outAnim = new AlphaAnimation(1, 0);
4.outAnim.setDuration(2000);
5. 
6.ImS.setInAnimation(inAnim);
7.ImS.setOutAnimation(outAnim);


MainActivity.java (Java Code)
01.package com.myapp;
02. 
03.import android.app.Activity;
04.import android.os.Bundle;
05.import android.view.Menu;
06.import android.view.View;
07.import android.view.animation.AlphaAnimation;
08.import android.view.animation.Animation;
09.import android.widget.ImageSwitcher;
10. 
11.public class MainActivity extends Activity {
12. 
13.    ImageSwitcher ImS;
14.     
15.    public void onCreate(Bundle savedInstanceState) {
16.        super.onCreate(savedInstanceState);
17.        setContentView(R.layout.activity_main);
18.         
19.        ImS = (ImageSwitcher) findViewById(R.id.imageSwitcher1);
20.         
21.        Animation inAnim = new AlphaAnimation(0, 1);
22.        inAnim.setDuration(2000);
23.        Animation outAnim = new AlphaAnimation(1, 0);
24.        outAnim.setDuration(2000);
25. 
26.        ImS.setInAnimation(inAnim);
27.        ImS.setOutAnimation(outAnim);
28.         
29.        ImS.setOnClickListener(new View.OnClickListener() {
30.           public void onClick(View v) { 
31.              ImS.showNext();
32.            }   
33.        }); 
34.      
35.    
36. 
37.    @Override
38.    public boolean onCreateOptionsMenu(Menu menu) {
39.        getMenuInflater().inflate(R.menu.activity_main, menu);
40.        return true;
41.    }
42.     
43.}


Screenshot

ImageSwitcher - Android Widgets

แสดงภาพแรก

ImageSwitcher - Android Widgets

เมื่อคลิกก็จะแสดงอีกภาพ




Example 2 การใช้ ImageSwitcher และรูปภาพแบบ ImageView แบบ Dynamic พร้อม ๆ กับมีปุ่ม Button กำหนดทิศทาง Next หรือ Previous

ImageSwitcher - Android Widgets

ออกแบบหน้าจอ GraphicLayout ด้วย Widget ตามรูป

activity_main.xml (XML Layout)
01.<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
02.    xmlns:tools="http://schemas.android.com/tools"
03.    android:layout_width="match_parent"
04.    android:layout_height="match_parent" >
05.            
06. 
07.         <LinearLayout
08.            android:id="@+id/LinearLayout01"
09.            android:layout_width="wrap_content"
10.            android:layout_height="wrap_content"
11.            android:layout_centerHorizontal="true"
12.            android:layout_marginTop="75dp" >
13.            <Button
14.                android:id="@+id/Button02"
15.                android:layout_width="wrap_content"
16.                android:layout_height="wrap_content"
17.                android:text="&lt;&lt;" />
18.     
19.            <Button
20.                android:id="@+id/Button01"
21.                android:layout_width="wrap_content"
22.                android:layout_height="wrap_content"
23.                android:text="&gt;&gt;" />
24.        </LinearLayout>
25.     
26.             
27.        <LinearLayout
28.            android:id="@+id/LinearLayout02"
29.            android:layout_width="wrap_content"
30.            android:layout_height="wrap_content"
31.            android:layout_centerHorizontal="true"
32.            android:layout_marginTop="75dp" >
33.             
34.                <ImageSwitcher
35.                    android:id="@+id/imageSwitcher1"
36.                    android:layout_width="wrap_content"
37.                    android:layout_height="wrap_content"
38.                    android:layout_marginTop="100dp" />
39. 
40.             
41.        </LinearLayout>
42. 
43.</RelativeLayout>

การสร้างเรียกรูปภาพแบบ Dynamic โดยอ้างอิงชื่อรูปภาพจากโฟเดอร์ดังรูป

ImageSwitcher - Android Widgets

โดยใช้การเก็บข้อมูลในรูปแบบของ Array

01.private Integer[] mImageIds = {
02.        R.drawable.pic_a,
03.        R.drawable.pic_b,
04.        R.drawable.pic_c,
05.        R.drawable.pic_d,
06.        R.drawable.pic_e,
07.        R.drawable.pic_f,
08.        R.drawable.pic_g,
09.        R.drawable.pic_h,
10.        R.drawable.pic_i
11.};


Code ทั้งหมด

MainActivity.java (Java Code)
001.package com.myapp;
002. 
003.import android.os.Bundle;
004.import android.app.ActionBar.LayoutParams;
005.import android.app.Activity;
006.import android.view.Menu;
007.import android.view.View;
008.import android.view.animation.AnimationUtils;
009.import android.widget.Button;
010.import android.widget.ImageSwitcher;
011.import android.widget.ImageView;
012.import android.widget.Toast;
013.import android.widget.ViewSwitcher.ViewFactory;
014. 
015. 
016.public class MainActivity extends Activity implements ViewFactory {
017. 
018.    private Integer[] mImageIds = {
019.            R.drawable.pic_a,
020.            R.drawable.pic_b,
021.            R.drawable.pic_c,
022.            R.drawable.pic_d,
023.            R.drawable.pic_e,
024.            R.drawable.pic_f,
025.            R.drawable.pic_g,
026.            R.drawable.pic_h,
027.            R.drawable.pic_i
028.    };
029.     
030.    ImageSwitcher iSwitcher;
031.    Button btnNext;
032.    Button btnPrev;
033.    int position = 0;
034.     
035.    @Override
036.    public void onCreate(Bundle savedInstanceState) {
037.        super.onCreate(savedInstanceState);
038.        setContentView(R.layout.activity_main);
039.          
040.       // imageSwitcher1
041.        iSwitcher = (ImageSwitcher) findViewById(R.id.imageSwitcher1);
042.        iSwitcher.setFactory(this);
043.        iSwitcher.setInAnimation(AnimationUtils.loadAnimation(this,
044.                android.R.anim.fade_in));
045.        iSwitcher.setOutAnimation(AnimationUtils.loadAnimation(this,
046.                android.R.anim.fade_out));   
047.         
048.        iSwitcher.setImageResource(mImageIds[0]);
049. 
050.         
051.        btnNext = (Button) findViewById(R.id.Button01);
052.        btnNext.setOnClickListener(new View.OnClickListener() {
053.               public void onClick(View v) { 
054.                   setPositionNext();
055.                   iSwitcher.setImageResource(mImageIds[position]);
056.                   Toast.makeText(MainActivity.this, "Your selected position = " + getResources().getResourceName(mImageIds[position]), Toast.LENGTH_SHORT).show();
057.                }   
058.        }); 
059.         
060.        btnPrev = (Button) findViewById(R.id.Button02);
061.        btnPrev.setOnClickListener(new View.OnClickListener() {
062.            public void onClick(View v) {
063.                setPositionPrev();
064.                iSwitcher.setImageResource(mImageIds[position]);
065.                Toast.makeText(MainActivity.this, "Your selected position = " + getResources().getResourceName(mImageIds[position]), Toast.LENGTH_SHORT).show();
066.            }
067.        });
068.         
069. 
070.                 
071. 
072.    }
073.     
074.    public void setPositionNext()
075.    {
076.        position++;
077.        if(position > mImageIds.length -1)
078.        {
079.            position = 0;
080.        }
081.    }
082.     
083.    public void setPositionPrev()
084.    {
085.        position--;
086.        if(position < 0)
087.        {
088.            position = mImageIds.length - 1;
089.        }  
090.    }
091.     
092.    public View makeView() {
093.        // TODO Auto-generated method stub
094.        ImageView iView = new ImageView(this);
095.        iView.setScaleType(ImageView.ScaleType.FIT_CENTER);
096.        iView.setLayoutParams(new
097.                ImageSwitcher.LayoutParams(
098.                        LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
099.        iView.setBackgroundColor(0xFF000000);
100.        return iView;
101.    }
102.     
103.    @Override
104.    public boolean onCreateOptionsMenu(Menu menu) {
105.        getMenuInflater().inflate(R.menu.activity_main, menu);
106.        return true;
107.    }
108. 
109.}


Screenshot

ImageSwitcher - Android Widgets

สดงรูปภาพ ซึ่งสามารถกด ถัดไป (Next) หรือ ย้อนกลับได้ (Previous)




Example 3 การใช้ ImageSwitcher และ GestureDetector เพื่อควบคุมการ Slide รุปภาพในทิศทาง ซ้าย-ขวา

ImageSwitcher - Android Widgets

ออกแบบหน้าจอ GraphicLayout ด้วย Widget ตามรูป

activity_main.xml (XML Layout)
01.<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
02.    xmlns:tools="http://schemas.android.com/tools"
03.    android:layout_width="match_parent"
04.    android:layout_height="match_parent" >
05.               
06.             
07.        <LinearLayout
08.            android:id="@+id/LinearLayout02"
09.            android:layout_width="wrap_content"
10.            android:layout_height="wrap_content"
11.            android:layout_centerHorizontal="true"
12.            android:layout_marginTop="50dp" >
13.             
14.                <ImageSwitcher
15.                    android:id="@+id/imageSwitcher1"
16.                    android:layout_width="wrap_content"
17.                    android:layout_height="wrap_content"
18.                    android:layout_marginTop="50dp" />
19. 
20.             
21.        </LinearLayout>
22. 
23.</RelativeLayout>


MainActivity.java (Java Code)
001.package com.myapp;
002. 
003.import android.app.ActionBar.LayoutParams;
004.import android.app.Activity;
005.import android.os.Bundle;
006.import android.view.GestureDetector;
007.import android.view.GestureDetector.OnGestureListener;
008.import android.view.MotionEvent;
009.import android.view.View;
010.import android.view.animation.AlphaAnimation;
011.import android.view.animation.Animation;
012.import android.widget.ImageSwitcher;
013.import android.widget.ImageView;
014.import android.widget.TextView;
015.import android.widget.ViewSwitcher.ViewFactory;
016.import android.widget.Toast;
017. 
018.public class MainActivity extends Activity implements ViewFactory, OnGestureListener {
019. 
020.    GestureDetector gd;
021.    TextView tv1;
022.     
023.    private Integer[] mImageIds = {
024.            R.drawable.pic_a,
025.            R.drawable.pic_b,
026.            R.drawable.pic_c,
027.            R.drawable.pic_d,
028.            R.drawable.pic_e,
029.            R.drawable.pic_f,
030.            R.drawable.pic_g,
031.            R.drawable.pic_h,
032.            R.drawable.pic_i
033.    };
034.     
035.    private static final int SWIPE_MIN_DISTANCE = 120;
036.    private static final int SWIPE_MAX_OFF_PATH = 250;
037.    private static final int SWIPE_THRESHOLD_VELOCITY = 100;
038.    int position = 0;
039.    int i = 0;
040.    ImageSwitcher iSwitcher;
041. 
042.    @Override
043.    public void onCreate(Bundle savedInstanceState) {
044.        super.onCreate(savedInstanceState);
045.        setContentView(R.layout.activity_main);
046.         
047.         
048.         
049.        Animation inAnim = new AlphaAnimation(0, 1);
050.        inAnim.setDuration(1000);
051.        Animation outAnim = new AlphaAnimation(1, 0);
052.        outAnim.setDuration(1000);
053.         
054.       // imageSwitcher1
055.        iSwitcher = (ImageSwitcher) findViewById(R.id.imageSwitcher1);
056.        iSwitcher.setFactory(this);
057.        iSwitcher.setInAnimation(inAnim);
058.        iSwitcher.setOutAnimation(outAnim);   
059.             
060.            iSwitcher.setImageResource(mImageIds[0]);
061.     
062.         
063.        gd = new GestureDetector(this, this);
064.    }
065. 
066.    @Override
067.    public boolean onTouchEvent(MotionEvent event) {
068.        if (gd.onTouchEvent(event))
069.            return true;
070.        else
071.            return false;
072.    }
073. 
074.    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
075.            float velocityY) {
076.         
077.           try {
078.                if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH)
079.                    return false;
080.                // right to left swipe
081.                if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE
082.                        && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
083.                       setPositionNext();
084.                       iSwitcher.setImageResource(mImageIds[position]);
085.                       Toast.makeText(MainActivity.this, getResources().getResourceName(mImageIds[position]), Toast.LENGTH_SHORT).show();
086. 
087.                } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE
088.                        && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
089.                    //left to right flip
090.                    setPositionPrev();
091.                    iSwitcher.setImageResource(mImageIds[position]);
092.                    Toast.makeText(MainActivity.this, getResources().getResourceName(mImageIds[position]), Toast.LENGTH_SHORT).show();
093.               }
094.            } catch (Exception e) {
095.                // nothing
096.                return true;
097.            }
098.             
099.        return true;
100.    }
101. 
102.    public void setPositionNext()
103.    {
104.        position++;
105.        if(position > mImageIds.length -1)
106.        {
107.            position = 0;
108.        }
109.    }
110.     
111.    public void setPositionPrev()
112.    {
113.        position--;
114.        if(position < 0)
115.        {
116.            position = mImageIds.length - 1;
117.        }  
118.    }
119.     
120.    public View makeView() {
121.        // TODO Auto-generated method stub
122.        ImageView iView = new ImageView(this);
123.        iView.setScaleType(ImageView.ScaleType.FIT_CENTER);
124.        iView.setLayoutParams(new
125.                ImageSwitcher.LayoutParams(
126.                        LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
127.        iView.setBackgroundColor(0xFF000000);
128.        return iView;
129.    }
130.     
131.    public boolean onDown(MotionEvent arg0) {
132.        // TODO Auto-generated method stub
133.        return false;
134.    }
135.     
136.    public void onLongPress(MotionEvent arg0) {
137.        // TODO Auto-generated method stub
138. 
139.    }
140. 
141.    public boolean onScroll(MotionEvent arg0, MotionEvent arg1, float arg2,
142.            float arg3) {
143.        // TODO Auto-generated method stub
144.        return false;
145.    }
146. 
147.    public void onShowPress(MotionEvent arg0) {
148.        // TODO Auto-generated method stub
149. 
150.    }
151. 
152.    public boolean onSingleTapUp(MotionEvent arg0) {
153.        // TODO Auto-generated method stub
154.        return false;
155.    }
156. 
157.}


Screenshot

ImageSwitcher - Android Widgets

สามารถ Slide ซ้่าย-ขวา เพื่อเปลี่ยนหรือเลื่อนดูรูปภาพ

ImageSwitcher - Android Widgets

แสดงรูปภาพจากผลลัพธ์ที่ได้



Example 4 การใช้ ImageSwitcher กับ Widgets Gallery โดยจะแสดงรูปภาพในกรอบเล็ก ๆ และสามารถเลือกรูปภาพเพื่อดูขนาดใหญ่ได้

ImageSwitcher - Android Widgets

ออกแบบหน้าจอ GraphicLayout ด้วย Widget ตามรูป

activity_main.xml (XML Layout)
01.<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
02.    xmlns:tools="http://schemas.android.com/tools"
03.    android:layout_width="match_parent"
04.    android:layout_height="match_parent" >
05.     
06.    <Gallery
07.        android:id="@+id/gallery1"
08.        android:layout_width="wrap_content"
09.        android:layout_height="wrap_content" />
10.     
11.        <ImageSwitcher
12.        android:id="@+id/imageSwitcher1"
13.        android:layout_width="wrap_content"
14.        android:layout_height="wrap_content"
15.        android:layout_marginTop="100dp" >
16.    </ImageSwitcher>
17. 
18.</TableLayout>


MainActivity.java (Java Code)
001.package com.myapp;
002. 
003.import android.os.Bundle;
004.import android.app.ActionBar.LayoutParams;
005.import android.app.Activity;
006.import android.content.Context;
007.import android.view.Menu;
008.import android.view.View;
009.import android.view.ViewGroup;
010.import android.view.animation.AnimationUtils;
011.import android.widget.AdapterView;
012.import android.widget.AdapterView.OnItemClickListener;
013.import android.widget.BaseAdapter;
014.import android.widget.Gallery;
015.import android.widget.ImageSwitcher;
016.import android.widget.ImageView;
017.import android.widget.Toast;
018.import android.widget.ViewSwitcher.ViewFactory;
019. 
020. 
021.public class MainActivity extends Activity implements ViewFactory {
022. 
023.     
024.    private Integer[] mImageIds = {
025.            R.drawable.pic_a,
026.            R.drawable.pic_b,
027.            R.drawable.pic_c,
028.            R.drawable.pic_d,
029.            R.drawable.pic_e,
030.            R.drawable.pic_f,
031.            R.drawable.pic_g,
032.            R.drawable.pic_h,
033.            R.drawable.pic_i
034.    };
035.     
036.    ImageSwitcher iSwitcher;
037.     
038.    @Override
039.    public void onCreate(Bundle savedInstanceState) {
040.        super.onCreate(savedInstanceState);
041.        setContentView(R.layout.activity_main);
042.         
043.        // gallery1
044.        Gallery galry = (Gallery) findViewById(R.id.gallery1);
045.        galry.setSpacing(1);
046.        galry.setAdapter(new ImageAdapter(this));
047.         
048.       // imageSwitcher1
049.        iSwitcher = (ImageSwitcher) findViewById(R.id.imageSwitcher1);
050.        iSwitcher.setFactory(this);
051.        iSwitcher.setInAnimation(AnimationUtils.loadAnimation(this,
052.                android.R.anim.fade_in));
053.        iSwitcher.setOutAnimation(AnimationUtils.loadAnimation(this,
054.                android.R.anim.fade_out));       
055. 
056.        galry.setOnItemClickListener(new OnItemClickListener() {
057.            public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
058.             
059.                iSwitcher.setImageResource(mImageIds[position]);
060.                Toast.makeText(MainActivity.this, "Your selected position = " + getResources().getResourceName(mImageIds[position]), Toast.LENGTH_SHORT).show();
061.             
062.            }
063.        });
064.    }
065.     
066.     
067.    public class ImageAdapter extends BaseAdapter {
068.        private Context mContext;
069. 
070.        public ImageAdapter(Context c) {
071.            mContext = c;
072.        }
073. 
074.        public int getCount() {
075.            return mImageIds.length;
076.        }
077. 
078.        public Object getItem(int position) {
079.            return position;
080.        }
081. 
082.        public long getItemId(int position) {
083.            return position;
084.        }
085. 
086.        public View getView(int arg0, View arg1, ViewGroup arg2) {
087.            // TODO Auto-generated method stub
088.            ImageView i = new ImageView(mContext);
089. 
090.            i.setImageResource(mImageIds[arg0]);
091.            i.setLayoutParams(new Gallery.LayoutParams(100, 100));
092.            //i.setScaleType(ImageView.ScaleType.CENTER);
093.            //i.setScaleType(ImageView.ScaleType.CENTER_CROP);         
094.            //i.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
095.            //i.setScaleType(ImageView.ScaleType.FIT_CENTER);
096.            //i.setScaleType(ImageView.ScaleType.FIT_XY);
097.            //i.setScaleType(ImageView.ScaleType.FIT_END);
098.            i.setScaleType(ImageView.ScaleType.FIT_XY);
099. 
100.            return i;
101.        }
102.    }
103.     
104.    public View makeView() {
105.        // TODO Auto-generated method stub
106.        ImageView iView = new ImageView(this);
107.        iView.setScaleType(ImageView.ScaleType.FIT_CENTER);
108.        iView.setLayoutParams(new
109.                ImageSwitcher.LayoutParams(
110.                        LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
111.        iView.setBackgroundColor(0xFF000000);
112.        return iView;
113.    }
114.     
115.    @Override
116.    public boolean onCreateOptionsMenu(Menu menu) {
117.        getMenuInflater().inflate(R.menu.activity_main, menu);
118.        return true;
119.    }
120. 
121.}


Screenshot

ImageSwitcher - Android Widgets

แสดงรูปภาพ Gallery และ ImageSwitcher

   
Hate it
Don't like it
It's ok
Like it
Love it
Share

Property & Method (Others Related)

Android Transitions Widgets
AdapterViewFlipper - Android Widgets Example
StackView - Android Widgets Example
TextSwitcher - Android Widgets Example
ViewAnimator - Android Widgets Example
ViewFlipper - Android Widgets Example
ViewSwitcher - Android Widgets Example

ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท


ลองใช้ค้นหาข้อมูล


   


Bookmark.   
       
  By : ThaiCreate.Com Team (บทความเป็นลิขสิทธิ์ของเว็บไทยครีเอทห้ามนำเผยแพร่ ณ เว็บไซต์อื่น ๆ)
  Score Rating :  
  Create/Update Date : 2012-07-01 16:22:31 / 2012-07-15 11:19:06
  Download : No files
 Sponsored Links / Related

 
Android Custom Adapter
Rating :

 
Android People Contact List, Name, Phone No, Photo Picture, Email and Address
Rating :

 
Android Rating (Vote) and ListView Part 1
Rating :

 
Android Rating (Vote) and ListView Part 2 (Member Login and Average Rating)
Rating :

 
Android PhoneGap (jQuery Mobile) Create Convert App from Website(URL)
Rating :

 
Android Capture Image and Camera Capture Screenshot (android.view.SurfaceView)
Rating :

 
Android Pull Down to Refresh And Release to Refresh or Update (Part 1)
Rating :

 
Android Pull Down to Refresh And Release to Update (Part 2 , PHP & MySQL)
Rating :


ThaiCreate.Com Forum
Comunity Forum Free Web Script
Jobs Freelance Free Uploads
Free Web Hosting Free Tools

สอน PHP ผ่าน Youtube ฟรี
สอน Android การเขียนโปรแกรม Android
สอน Windows Phone การเขียนโปรแกรม Windows Phone 7 และ 8
สอน iOS การเขียนโปรแกรม iPhone, iPad
สอน Java การเขียนโปรแกรม ภาษา Java
สอน Java GUI การเขียนโปรแกรม ภาษา Java GUI
สอน JSP การเขียนโปรแกรม ภาษา Java
สอน jQuery การเขียนโปรแกรม ภาษา jQuery
สอน .Net การเขียนโปรแกรม ภาษา .Net
Free Tutorial
สอน Google Maps Api
สอน Windows Service
สอน Entity Framework
สอน Android
สอน Java เขียน Java
Java GUI Swing
สอน JSP (Web App)
iOS (iPhone,iPad)
Windows Phone
Windows Azure
Windows Store
Laravel Framework
Yii PHP Framework
สอน jQuery
สอน jQuery กับ Ajax
สอน PHP OOP (Vdo)
Ajax Tutorials
SQL Tutorials
สอน SQL (Part 2)
JavaScript Tutorial
Javascript Tips
VBScript Tutorial
VBScript Validation
Microsoft Access
MySQL Tutorials
-- Stored Procedure
MariaDB Database
SQL Server Tutorial
SQL Server 2005
SQL Server 2008
SQL Server 2012
-- Stored Procedure
Oracle Database
-- Stored Procedure
SVN (Subversion)
แนวทางการทำ SEO
ปรับแต่งเว็บให้โหลดเร็ว


Hit Link
   





ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2025 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่