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


Android ListView Padding and Pagination

Android ListView Padding and Pagination ตัวอย่างการเขียน Android กับ ListView เพื่อจัดการ Padding และ Pagination โดยเมื่อข้อมูลใน ListView มีจำนวนมาก จะใช้การแบ่งข้อมูลเหล่านั้นแสดงผลออกเป็นหลาย ๆ หน้า แต่ล่ะหน้าจะแสดงข้อมูลขึ้นอยู่กับเรากำหนดขึ้น และมีปุ่ม Back(Previous) และ Next สำหรับการคลิกดูข้อมูลในหน้าถ้ดไป หรือจะย้อนหลังดูข้อมูล พร้อมทั้งการแสดงเลขหน้า ลำดับของข้อมูล

Android ListView Padding and Pagination


Exalple 1 การอ่านข้อมูลจาก JSON และมาแสดงผลแบ่งหน้าข้อมูลบน ListView

โครงสร้างของไฟล์ประกอบด้วย 3 ไฟล์คือ MainActivity.java, activity_main.xml และ activity_column.xml

Android ListView Padding and Pagination

activity_main.xml
01.<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
02.    android:id="@+id/tableLayout1"
03.    android:layout_width="fill_parent"
04.    android:layout_height="fill_parent">
05.  
06.    <TableRow
07.      android:id="@+id/tableRow1"
08.      android:layout_width="wrap_content"
09.      android:layout_height="wrap_content" >
10.      
11.     <TextView
12.        android:id="@+id/textView1"
13.        android:layout_width="wrap_content"
14.        android:layout_height="wrap_content"
15.        android:gravity="center"
16.        android:text="ListView Pagination : "
17.        android:layout_span="1" />
18.      
19. 
20.     <Button
21.         android:id="@+id/btnPre"
22.         android:layout_width="wrap_content"
23.         android:layout_height="wrap_content"
24.         android:text="&lt;&lt; Prev" />
25.      
26. 
27.     <Button
28.         android:id="@+id/btnNext"
29.         android:layout_width="wrap_content"
30.         android:layout_height="wrap_content"
31.         android:text="Next >>" />
32.             
33.    </TableRow>
34. 
35.    <View
36.        android:layout_height="1dip"
37.        android:background="#CCCCCC" />
38.  
39.  <LinearLayout
40.        android:orientation="horizontal"
41.        android:layout_width="fill_parent"
42.        android:layout_height="wrap_content"
43.        android:layout_weight="0.1">  
44.      
45.     <ListView
46.         android:id="@+id/listView1"
47.         android:layout_width="match_parent"
48.         android:layout_height="wrap_content">
49.     </ListView>
50.             
51.    </LinearLayout>
52. 
53.    <View
54.        android:layout_height="1dip"
55.        android:background="#CCCCCC" />
56.           
57.    <LinearLayout
58.      android:id="@+id/LinearLayout1"
59.      android:layout_width="wrap_content"
60.      android:layout_height="wrap_content"
61.      android:padding="5dip" >
62. 
63.        <TextView
64.            android:id="@+id/textView2"
65.            android:layout_width="wrap_content"
66.            android:layout_height="wrap_content"
67.            android:text="By.. ThaiCreate.Com" />
68. 
69.    </LinearLayout>
70.     
71.</TableLayout>


Android ListView Padding and Pagination

activity_column.xml
01.<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
02.    android:id="@+id/linearLayout1"
03.    android:layout_width="fill_parent"
04.    android:layout_height="fill_parent" >
05. 
06.    <TextView
07.    android:id="@+id/ColRowID"
08.        android:layout_width="0dp"
09.        android:layout_height="wrap_content"
10.        android:layout_weight="0.4"
11.        android:text="RowID"/>
12.         
13.    <TextView
14.    android:id="@+id/ColItemID"
15.        android:layout_width="0dp"
16.        android:layout_height="wrap_content"
17.        android:layout_weight="1"
18.        android:text="ItemID"/>
19. 
20.    <TextView
21.        android:id="@+id/ColName"
22.        android:layout_width="0dp"
23.        android:layout_height="wrap_content"
24.        android:layout_weight="2"
25.        android:text="Name"/>
26. 
27.    <TextView
28.        android:id="@+id/ColDescription"
29.        android:layout_width="0dp"
30.        android:layout_height="wrap_content"
31.        android:layout_weight="1"
32.        android:text="Description" />
33. 
34.</LinearLayout>




MainActivity.java
001.package com.myapp;
002. 
003.import java.util.ArrayList;
004.import java.util.HashMap;
005. 
006.import org.json.JSONArray;
007.import org.json.JSONException;
008.import org.json.JSONObject;
009. 
010.import android.os.Bundle;
011.import android.app.Activity;
012.import android.view.Menu;
013.import android.view.View;
014.import android.widget.Button;
015.import android.widget.ListView;
016.import android.widget.SimpleAdapter;
017. 
018.public class MainActivity extends Activity {
019.     
020.    public String strJSON;
021.    public int currentPage = 1;
022.    public ListView lisView1;
023.     
024.    public Button btnNext;
025.    public Button btnPre;
026.     
027.    @Override
028.    public void onCreate(Bundle savedInstanceState) {
029.        super.onCreate(savedInstanceState);
030.        setContentView(R.layout.activity_main);
031.        
032.        // listView1
033.        lisView1 = (ListView)findViewById(R.id.listView1);
034.         
035.        // Next
036.        btnNext = (Button) findViewById(R.id.btnNext);
037.        // Perform action on click
038.        btnNext.setOnClickListener(new View.OnClickListener() {
039.            public void onClick(View v) {
040.                currentPage = currentPage + 1;
041.                ShowData();
042.            }
043.        });
044.         
045.        // Previous
046.        btnPre = (Button) findViewById(R.id.btnPre);
047.        // Perform action on click
048.        btnPre.setOnClickListener(new View.OnClickListener() {
049.            public void onClick(View v) {
050.                currentPage = currentPage - 1;
051.                ShowData();
052.            }
053.        });
054.         
055.         
056.    strJSON = "[{\"ItemID\":\"Items 01\",\"Name\":\"Data Row 01\",\"Description\":\"Desc 01\"}" +
057.    ",{\"ItemID\":\"Items 02\",\"Name\":\"Data Row 02\",\"Description\":\"Desc 02\"}" +
058.    ",{\"ItemID\":\"Items 03\",\"Name\":\"Data Row 03\",\"Description\":\"Desc 03\"}" +
059.    ",{\"ItemID\":\"Items 04\",\"Name\":\"Data Row 04\",\"Description\":\"Desc 04\"}" +
060.    ",{\"ItemID\":\"Items 05\",\"Name\":\"Data Row 05\",\"Description\":\"Desc 05\"}" +
061.    ",{\"ItemID\":\"Items 06\",\"Name\":\"Data Row 06\",\"Description\":\"Desc 06\"}" +
062.    ",{\"ItemID\":\"Items 07\",\"Name\":\"Data Row 07\",\"Description\":\"Desc 07\"}" +
063.    ",{\"ItemID\":\"Items 08\",\"Name\":\"Data Row 08\",\"Description\":\"Desc 08\"}" +
064.    ",{\"ItemID\":\"Items 09\",\"Name\":\"Data Row 09\",\"Description\":\"Desc 09\"}" +
065.    ",{\"ItemID\":\"Items 10\",\"Name\":\"Data Row 10\",\"Description\":\"Desc 10\"}" +
066.    ",{\"ItemID\":\"Items 11\",\"Name\":\"Data Row 11\",\"Description\":\"Desc 11\"}" +
067.    ",{\"ItemID\":\"Items 12\",\"Name\":\"Data Row 12\",\"Description\":\"Desc 12\"}" +
068.    ",{\"ItemID\":\"Items 13\",\"Name\":\"Data Row 13\",\"Description\":\"Desc 13\"}" +
069.    ",{\"ItemID\":\"Items 14\",\"Name\":\"Data Row 14\",\"Description\":\"Desc 14\"}" +
070.    ",{\"ItemID\":\"Items 15\",\"Name\":\"Data Row 15\",\"Description\":\"Desc 15\"}" +
071.    ",{\"ItemID\":\"Items 16\",\"Name\":\"Data Row 16\",\"Description\":\"Desc 16\"}" +
072.    ",{\"ItemID\":\"Items 17\",\"Name\":\"Data Row 17\",\"Description\":\"Desc 17\"}" +
073.    ",{\"ItemID\":\"Items 18\",\"Name\":\"Data Row 18\",\"Description\":\"Desc 18\"}" +
074.    ",{\"ItemID\":\"Items 19\",\"Name\":\"Data Row 19\",\"Description\":\"Desc 19\"}" +
075.    ",{\"ItemID\":\"Items 20\",\"Name\":\"Data Row 20\",\"Description\":\"Desc 20\"}" +
076.    ",{\"ItemID\":\"Items 21\",\"Name\":\"Data Row 21\",\"Description\":\"Desc 21\"}" +
077.    ",{\"ItemID\":\"Items 22\",\"Name\":\"Data Row 22\",\"Description\":\"Desc 22\"}" +
078.    ",{\"ItemID\":\"Items 23\",\"Name\":\"Data Row 23\",\"Description\":\"Desc 23\"}" +
079.    ",{\"ItemID\":\"Items 24\",\"Name\":\"Data Row 24\",\"Description\":\"Desc 24\"}" +
080.    ",{\"ItemID\":\"Items 25\",\"Name\":\"Data Row 25\",\"Description\":\"Desc 25\"}" +
081.    ",{\"ItemID\":\"Items 26\",\"Name\":\"Data Row 26\",\"Description\":\"Desc 26\"}" +
082.    ",{\"ItemID\":\"Items 27\",\"Name\":\"Data Row 27\",\"Description\":\"Desc 27\"}" +
083.    ",{\"ItemID\":\"Items 28\",\"Name\":\"Data Row 28\",\"Description\":\"Desc 28\"}" +
084.    ",{\"ItemID\":\"Items 29\",\"Name\":\"Data Row 29\",\"Description\":\"Desc 29\"}" +
085.    ",{\"ItemID\":\"Items 30\",\"Name\":\"Data Row 30\",\"Description\":\"Desc 29\"}" +
086.    ",{\"ItemID\":\"Items 31\",\"Name\":\"Data Row 31\",\"Description\":\"Desc 31\"}]";
087. 
088.    ShowData();
089.    }
090.     
091.    public void ShowData()
092.    {
093.        try {
094.            JSONArray data = new JSONArray(strJSON);
095.             
096.            int displayPerPage = 5;   // Per Page
097.            int TotalRows = data.length();
098.            int indexRowStart = ((displayPerPage*currentPage)-displayPerPage);
099.            int TotalPage = 0;
100.            if(TotalRows<=displayPerPage)
101.            {
102.                TotalPage =1;
103.            }
104.            else if((TotalRows % displayPerPage)==0)
105.            {
106.                TotalPage =(TotalRows/displayPerPage) ;
107.            }
108.            else
109.            {
110.                TotalPage =(TotalRows/displayPerPage)+1;
111.                TotalPage = (int)TotalPage;
112.            }
113.            int indexRowEnd = displayPerPage * currentPage;
114.            if(indexRowEnd > TotalRows)
115.            {
116.                indexRowEnd = TotalRows;
117.            }
118.             
119.            // Disabled Button Next
120.            if(currentPage >= TotalPage)
121.            {
122.                btnNext.setEnabled(false);
123.            }
124.            else
125.            {
126.                btnNext.setEnabled(true);
127.            }
128.             
129.            // Disabled Button Previos
130.            if(currentPage <= 1)
131.            {
132.                btnPre.setEnabled(false);
133.            }
134.            else
135.            {
136.                btnPre.setEnabled(true);
137.            }
138.             
139.            // Load Data from Index
140.            int RowID = 1;
141.            ArrayList<HashMap<String, String>> MyArrList = new ArrayList<HashMap<String, String>>();
142.            HashMap<String, String> map;
143.             
144.            // RowID
145.            if(currentPage > 1)
146.            {
147.                RowID = (displayPerPage * (currentPage-1)) + 1;
148.            }
149.             
150.            for(int i = indexRowStart; i < indexRowEnd; i++){
151.                JSONObject c = data.getJSONObject(i);
152.                map = new HashMap<String, String>();
153.                map.put("RowID", String.valueOf(RowID));
154.                map.put("ItemID", c.getString("ItemID"));
155.                map.put("Name", c.getString("Name"));
156.                map.put("Description", c.getString("Description"));
157.                MyArrList.add(map);
158.                RowID = RowID + 1;
159.                 
160.            }
161. 
162.            SimpleAdapter sAdap;
163.            sAdap = new SimpleAdapter(MainActivity.this, MyArrList, R.layout.activity_column,
164.                    new String[] {"RowID", "ItemID", "Name", "Description"}, new int[] {R.id.ColRowID, R.id.ColItemID, R.id.ColName, R.id.ColDescription});     
165.            lisView1.setAdapter(sAdap);
166.             
167.        } catch (JSONException e) {
168.            // TODO Auto-generated catch block
169.            e.printStackTrace();
170.        }
171.    }
172.     
173. 
174.    @Override
175.    public boolean onCreateOptionsMenu(Menu menu) {
176.        getMenuInflater().inflate(R.menu.activity_main, menu);
177.        return true;
178.    }
179.     
180.}


จาก Code หลักการง่าย ๆ ก็คือ จำนวนข้อมูลมาคำนวณจำนวนหน้า โดยหาตำแหน่งของ Array ตามนำนวนหน้าและจำนวนข้อมูลที่ต้องแสดงผล

01.int displayPerPage = 5;   // Per Page
02.int TotalRows = data.length();
03.int indexRowStart = ((displayPerPage*currentPage)-displayPerPage);
04.int TotalPage = 0;
05.if(TotalRows<=displayPerPage)
06.{
07.    TotalPage =1;
08.}
09.else if((TotalRows % displayPerPage)==0)
10.{
11.    TotalPage =(TotalRows/displayPerPage) ;
12.}
13.else
14.{
15.    TotalPage =(TotalRows/displayPerPage)+1;
16.    TotalPage = (int)TotalPage;
17.}
18.int indexRowEnd = displayPerPage * currentPage;
19.if(indexRowEnd > TotalRows)
20.{
21.    indexRowEnd = TotalRows;
22.}

การคำนวณหาตำแหน่งของ Array ที่จะแสดงข้อมูลในแต่ล่ะหน้า โดยจะได้่ indexRowStart และ indexRowEnd เป็น Index ของ Array ที่จะแสดงข้อมูลในหน้านั้น ๆ

Screenshot

Android ListView Padding and Pagination

ปุ่ม << Prev และ ปุ่ม Next >> โดยถ้าอยู่หน้าแรก ปุ่ม Previous จะถุก Disabled

Android ListView Padding and Pagination

แสดงข้อมูลในหน้าถัดไป

Android ListView Padding and Pagination

เมื่ออยู่หน้าสุดท้ายปุ่ม Next >> จะถูก Disabled




Example 2 การแบ่งหน้าข้อมูลบน ListView ที่อยู่ในรุปแบบของ ArrayList

โครงสร้างของไฟล์ประกอบด้วย 3 ไฟล์คือ MainActivity.java, activity_main.xml และ activity_column.xml

Android ListView Padding and Pagination

activity_main.xml
01.<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
02.    android:id="@+id/tableLayout1"
03.    android:layout_width="fill_parent"
04.    android:layout_height="fill_parent">
05.  
06.    <TableRow
07.      android:id="@+id/tableRow1"
08.      android:layout_width="wrap_content"
09.      android:layout_height="wrap_content" >
10.      
11.     <TextView
12.        android:id="@+id/textView1"
13.        android:layout_width="wrap_content"
14.        android:layout_height="wrap_content"
15.        android:gravity="center"
16.        android:text="ListView Pagination : "
17.        android:layout_span="1" />
18.      
19. 
20.     <Button
21.         android:id="@+id/btnPre"
22.         android:layout_width="wrap_content"
23.         android:layout_height="wrap_content"
24.         android:text="&lt;&lt; Prev" />
25.      
26. 
27.     <Button
28.         android:id="@+id/btnNext"
29.         android:layout_width="wrap_content"
30.         android:layout_height="wrap_content"
31.         android:text="Next >>" />
32.             
33.    </TableRow>
34. 
35.    <View
36.        android:layout_height="1dip"
37.        android:background="#CCCCCC" />
38.  
39.  <LinearLayout
40.        android:orientation="horizontal"
41.        android:layout_width="fill_parent"
42.        android:layout_height="wrap_content"
43.        android:layout_weight="0.1">  
44.      
45.     <ListView
46.         android:id="@+id/listView1"
47.         android:layout_width="match_parent"
48.         android:layout_height="wrap_content">
49.     </ListView>
50.             
51.    </LinearLayout>
52. 
53.    <View
54.        android:layout_height="1dip"
55.        android:background="#CCCCCC" />
56.           
57.    <LinearLayout
58.      android:id="@+id/LinearLayout1"
59.      android:layout_width="wrap_content"
60.      android:layout_height="wrap_content"
61.      android:padding="5dip" >
62. 
63.        <TextView
64.            android:id="@+id/textView2"
65.            android:layout_width="wrap_content"
66.            android:layout_height="wrap_content"
67.            android:text="By.. ThaiCreate.Com" />
68. 
69.    </LinearLayout>
70.     
71.</TableLayout>


Android ListView Padding and Pagination



activity_column.xml
01.<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
02.    android:id="@+id/linearLayout1"
03.    android:layout_width="fill_parent"
04.    android:layout_height="fill_parent" >
05. 
06.    <TextView
07.    android:id="@+id/ColRowID"
08.        android:layout_width="0dp"
09.        android:layout_height="wrap_content"
10.        android:layout_weight="0.4"
11.        android:text="RowID"/>
12.         
13.    <TextView
14.    android:id="@+id/ColItemID"
15.        android:layout_width="0dp"
16.        android:layout_height="wrap_content"
17.        android:layout_weight="1"
18.        android:text="ItemID"/>
19. 
20.    <TextView
21.        android:id="@+id/ColName"
22.        android:layout_width="0dp"
23.        android:layout_height="wrap_content"
24.        android:layout_weight="2"
25.        android:text="Name"/>
26. 
27.    <TextView
28.        android:id="@+id/ColDescription"
29.        android:layout_width="0dp"
30.        android:layout_height="wrap_content"
31.        android:layout_weight="1"
32.        android:text="Description" />
33. 
34.</LinearLayout>


MainActivity.java
001.package com.myapp;
002. 
003.import java.util.ArrayList;
004.import java.util.HashMap;
005. 
006. 
007.import android.os.Bundle;
008.import android.app.Activity;
009.import android.content.Context;
010.import android.view.LayoutInflater;
011.import android.view.Menu;
012.import android.view.View;
013.import android.view.ViewGroup;
014.import android.widget.BaseAdapter;
015.import android.widget.Button;
016.import android.widget.ListView;
017.import android.widget.TextView;
018. 
019.public class MainActivity extends Activity {
020.     
021.    public int currentPage = 1;
022.    public int displayPerPage = 6// Display Perpage
023.    public int indexRowStart = 0;
024.    public int indexRowEnd = 0;
025.    public int TotalRows = 0;
026.    public ListView lisView1;
027.     
028.    public Button btnNext;
029.    public Button btnPre;
030.     
031.    ArrayList<HashMap<String, String>> myArrList;
032.     
033.    @Override
034.    public void onCreate(Bundle savedInstanceState) {
035.        super.onCreate(savedInstanceState);
036.        setContentView(R.layout.activity_main);
037.        
038.        // listView1
039.        lisView1 = (ListView)findViewById(R.id.listView1);
040.         
041.        // Next
042.        btnNext = (Button) findViewById(R.id.btnNext);
043.        // Perform action on click
044.        btnNext.setOnClickListener(new View.OnClickListener() {
045.            public void onClick(View v) {
046.                currentPage = currentPage + 1;
047.                progressShowData();
048.            }
049.        });
050.         
051.        // Previous
052.        btnPre = (Button) findViewById(R.id.btnPre);
053.        // Perform action on click
054.        btnPre.setOnClickListener(new View.OnClickListener() {
055.            public void onClick(View v) {
056.                currentPage = currentPage - 1;
057.                progressShowData();
058.            }
059.        });
060.         
061.        /*
062.         * ArrayList Data
063.         * ArrayList Data
064.         * ArrayList Data
065.         */
066.        myArrList = new ArrayList<HashMap<String, String>>();
067.        HashMap<String, String> map;
068.        for(int i = 1; i<=53; i++)
069.        {
070.            map = new HashMap<String, String>();
071.            map.put("RowID", String.valueOf(i));
072.            map.put("ItemID", "Items " + (i));
073.            map.put("Name", "Data Row " + (i));
074.            map.put("Description", "Desc " + (i));
075.            myArrList.add(map);
076.             
077.        }
078.         
079.        progressShowData();
080.         
081.    }
082.     
083.    public void progressShowData()
084.    {
085.            // Total Record
086.            TotalRows = myArrList.size();
087.             
088.            // Start Index
089.            indexRowStart = ((displayPerPage*currentPage)-displayPerPage);
090.             
091.            int TotalPage = 0;
092.            if(TotalRows<=displayPerPage)
093.            {
094.                TotalPage =1;
095.            }
096.            else if((TotalRows % displayPerPage)==0)
097.            {
098.                TotalPage =(TotalRows/displayPerPage) ;
099.            }
100.            else
101.            {
102.                TotalPage =(TotalRows/displayPerPage)+1;
103.                TotalPage = (int)TotalPage;
104.            }
105.             
106.            // Disabled Button Next
107.            if(currentPage >= TotalPage)
108.            {
109.                btnNext.setEnabled(false);
110.            }
111.            else
112.            {
113.                btnNext.setEnabled(true);
114.            }
115.             
116.            // Disabled Button Previos
117.            if(currentPage <= 1)
118.            {
119.                btnPre.setEnabled(false);
120.            }
121.            else
122.            {
123.                btnPre.setEnabled(true);
124.            }
125.             
126.            // Show Data in listView
127.            lisView1.setAdapter(new myAdapter(this));
128. 
129.    }
130.     
131.    public class myAdapter extends BaseAdapter
132.    {
133.        private Context context;
134. 
135.        public myAdapter(Context c)
136.        {
137.            // TODO Auto-generated method stub
138.            context = c;
139.        }
140.  
141.        public int getCount() {
142.            // TODO Auto-generated method stub
143.            if(displayPerPage > TotalRows - indexRowStart)
144.            {
145.                return TotalRows - indexRowStart;
146.            }
147.            else
148.            {
149.                return displayPerPage;
150.            }
151.             
152.        }
153. 
154.  
155.        public Object getItem(int position) {
156.            // TODO Auto-generated method stub
157.            return position;
158.        }
159.  
160.        public long getItemId(int position) {
161.            // TODO Auto-generated method stub
162.            return position;
163.        }
164. 
165.        public View getView(final int position, View convertView,
166.                ViewGroup parent) {
167.     
168.            // TODO Auto-generated method stub
169.            LayoutInflater inflater = (LayoutInflater) context
170.                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
171.          
172.            if (convertView == null) {
173.                convertView = inflater.inflate(R.layout.activity_column, null);
174.            }
175. 
176.            // ColRowID
177.            TextView RowID = (TextView) convertView.findViewById(R.id.ColRowID);
178.            RowID.setText(myArrList.get(position+indexRowStart).get("RowID") +".");
179.     
180.            // ColItemID
181.            TextView ItemID = (TextView) convertView.findViewById(R.id.ColItemID);
182.            ItemID.setText(myArrList.get(position+indexRowStart).get("ItemID"));
183.             
184.            // ColName
185.            TextView Name = (TextView) convertView.findViewById(R.id.ColName);
186.            Name.setText(myArrList.get(position+indexRowStart).get("Name"));
187.             
188.            // ColDescription
189.            TextView Description = (TextView) convertView.findViewById(R.id.ColDescription);
190.            Description.setText(myArrList.get(position+indexRowStart).get("Description"));
191.            return convertView;
192.                 
193. 
194.        }
195. 
196.    }
197.     
198. 
199.    @Override
200.    public boolean onCreateOptionsMenu(Menu menu) {
201.        getMenuInflater().inflate(R.menu.activity_main, menu);
202.        return true;
203.    }
204.     
205.}




Screenshot

Android ListView Padding and Pagination

แสดงการแบ่งหน้าของข้อมูลที่อยุ่ใน ArrayList บน ListView

Android ListView Padding and Pagination

แสดงหน้าอื่น ๆ

Android ListView Padding and Pagination

เมื่อถึงหน้าสุดท้ายและจะไม่สามารถคลิกปุ่ม Next เพื่อไปหน้าถัดไปได้

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


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


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


   


Bookmark.   
       
  By : ThaiCreate.Com Team (บทความเป็นลิขสิทธิ์ของเว็บไทยครีเอทห้ามนำเผยแพร่ ณ เว็บไซต์อื่น ๆ)
  Score Rating :  
  Create/Update Date : 2012-08-25 16:38:37 / 2017-03-26 22:28:55
  Download : No files
 Sponsored Links / Related

 
Android ListView แบบ Custom Layout แสดงข้อมูล ListView หลายคอลัมบ์ Multiple Column
Rating :

 
Android ListView and ImageView Image / Text in ListView Custom Layout Column
Rating :

 
Android แสดงรูปภาพ ImageView จาก Web URL ของเว็บไซต์ บน ListView
Rating :

 
Android กับ ListView แสดงข้อมูลจาก Database ของ SQLite
Rating :

 
Android ListView and Checkbox
Rating :

 
Android ListView and Buttons inside Create Custom Command in ListView
Rating :

 
Android Populate ListView ImageView get Image Resource from SD Card
Rating :

 
Android EditText or Textbox in ListView
Rating :

 
Android Gesture on ListView Detecting Sliding Items (Flip and Swipe)
Rating :

 
Android and Web Server ของ PHP กับ MySQL แสดงบน ListView ในรูปแบบของ JSON
Rating :

 
Android JSON Retrieving Data from URL Web Server (PHP MySQL and JSON)
Rating :

 
Android ProgressDialog When Click Item in ListView for Download file from Server
Rating :

 
Android Multiple Upload Send file to Server and Show Items ProgressBar in ListView
Rating :

 
Android Multiple Download file in ListView and Show Progress unit percentage
Rating :

 
Android AsyncTask update ListView notifyDataSetChanged when Items Load finish
Rating :

 
Android (ListView/GridView) get Result from Web Server and Paging Pagination
Rating :

 
Android Performance of Listview
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 อัตราราคา คลิกที่นี่