導航:首頁 > 操作系統 > android滾動分頁

android滾動分頁

發布時間:2022-10-06 02:25:40

① 如何在android studio 中的分頁滑動中使用其布局中的listview

這個是Viewpager 嵌套fragment 實現的 listview 的點擊監聽器OnItemClickListener 可以實現點擊進入相對應頁面

② android 下拉滾動頁面怎麼實現

以下是我自己花功夫編寫了一種非常簡單的下拉刷新實現方案,現在拿出來和大家分享一下。相信在閱讀完本篇文章之後,大家都可以在自己的項目中一分鍾引入下拉刷新功能 最近項目中需要用到ListView下拉刷新的功能,一開始想圖省事,在網上直接找一個現成的,可是嘗試了網上多個版本的下拉刷新之後發現效果都不 怎麼理想。有些是因為功能不完整或有Bug,有些是因為使用起來太復雜,十全十美的還真沒找到。因此我也是放棄了在網上找現成代碼的想法,自己花功夫編寫 了一種非常簡單的下拉刷新實現方案,現在拿出來和大家分享一下。相信在閱讀完本篇文章之後,大家都可以在自己的項目中一分鍾引入下拉刷新功能。 首先講一下實現原理。這里我們將採取的方案是使用組合View的方式,先自定義一個布局繼承自LinearLayout,然後在這個布局中加入下拉 頭和ListView這兩個子元素,並讓這兩個子元素縱向排列。初始化的時候,讓下拉頭向上偏移出屏幕,這樣我們看到的就只有ListView了。然後對 ListView的touch事件進行監聽,如果當前ListView已經滾動到頂部並且手指還在向下拉的話,那就將下拉頭顯示出來,鬆手後進行刷新操 作,並將下拉頭隱藏。原理示意圖如下: 那我們現在就來動手實現一下,新建一個項目起名叫PullToRefreshTest,先在項目中定義一個下拉頭的布局文件pull_to_refresh/apk/res/android" xmlns:tools="schemas/tools" android:id="@+id/pull_to_refresh_head" android:layout_width="fill_parent" android:layout_height="60dip" > <LinearLayout android:layout_width="200dip" android:layout_height="60dip" android:layout_centerInParent="true" android:orientation="horizontal" > <RelativeLayout android:layout_width="0dip" android:layout_height="60dip" android:layout_weight="3" > <ImageView android:id="@+id/arrow" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:src="@drawable/arrow" /> <ProgressBar android:id="@+id/progress_bar" android:layout_width="30dip" android:layout_height="30dip" android:layout_centerInParent="true" android:visibility="gone" /> </RelativeLayout> <LinearLayout android:layout_width="0dip" android:layout_height="60dip" android:layout_weight="12" android:orientation="vertical" > <TextView android:id="@+id/description" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:gravity="center_horizontalbottom" android:text="@string/pull_to_refresh" /> <TextView android:id="@+id/updated_at" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:gravity="center_horizontaltop" android:text="@string/updated_at" /> </LinearLayout> </LinearLayout> </RelativeLayout> 在這個布局中,我們包含了一個下拉指示箭頭,一個下拉狀態文字提示,和一個上次更新的時間。當然,還有一個隱藏的旋轉進度條,只有正在刷新的時候我們才會將它顯示出來。 布局中所有引用的字元串我們都放在stringsmit(); new HideHeaderTask()/apk/res/android" xmlns:tools="schemas/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" > <com.example.pulltorefreshtest.RefreshableView android:id="@+id/refreshable_view" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ListView android:id="@+id/list_view" android:layout_width="fill_parent" android:layout_height="fill_parent" > </ListView> </com.example.pulltorefreshtest.RefreshableView> </RelativeLayout> 可以看到,我們在自定義的RefreshableView中加入了一個ListView,這就意味著給這個ListView加入了下拉刷新的功能,就是這么簡單! 然後我們再來看一下程序的主Activity,打開或新建MainActivity,加入如下代碼: 復制代碼 代碼如下: public class MainActivity extends Activity { RefreshableView refreshableView; ListView listView; ArrayAdapter<String> adapter; String[] items = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L" }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_main); refreshableView = (RefreshableView) findViewById(R.id.refreshable_view); listView = (ListView) findViewById(R.id.list_view); adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items); listView.setAdapter(adapter); refreshableView.setOnRefreshListener(new PullToRefreshListener() { @Override public void onRefresh() { try { Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); } refreshableView.finishRefreshing(); } }, 0); } } 可 以看到,我們通過調用RefreshableView的setOnRefreshListener方法注冊了一個監聽器,當ListView正在刷新時就 會回調監聽器的onRefresh方法,刷新的具體邏輯就在這里處理。而且這個方法已經自動開啟了線程,可以直接在onRefresh方法中進行耗時操 作,比如向伺服器請求最新數據等,在這里我就簡單讓線程睡眠3秒鍾。另外在onRefresh方法的最後,一定要調用RefreshableView中的 finishRefreshing方法,這個方法是用來通知RefreshableView刷新結束了,不然我們的ListView將一直處於正在刷新的 狀態。 不知道大家有沒有注意到,setOnRefreshListener這個方法其實是有兩個參數的,我們剛剛也是傳入了一個不起眼的 0。那這第二個參數是用來做什麼的呢?由於RefreshableView比較智能,它會自動幫我們記錄上次刷新完成的時間,然後下拉的時候會在下拉頭中 顯示距上次刷新已過了多久。這是一個非常好用的功能,讓我們不用再自己手動去記錄和計算時間了,但是卻存在一個問題。如果當前我們的項目中有三個地方都使 用到了下拉刷新的功能,現在在一處進行了刷新,其它兩處的時間也都會跟著改變!因為刷新完成的時間是記錄在配置文件中的,由於在一處刷新更改了配置文件, 導致在其它兩處讀取到的配置文件時間已經是更改過的了。那解決方案是什麼?就是每個用到下拉刷新的地方,給setOnRefreshListener方法 的第二個參數中傳入不同的id就行了。這樣各處的上次刷新完成時間都是單獨記錄的,相互之間就不會再有影響。 好了,全部的代碼都在這里了,讓我們來運行一下,看看效果吧。 效果看起來還是非常不錯的。我們最後再來總結一下,在項目中引入ListView下拉刷新功能只需三步: 1. 在Activity的布局文件中加入自定義的RefreshableView,並讓ListView包含在其中。 2. 在Activity中調用RefreshableView的setOnRefreshListener方法注冊回調介面。 3. 在onRefresh方法的最後,記得調用RefreshableView的finishRefreshing方法,通知刷新結束。 從此以後,在項目的任何地方,一分鍾引入下拉刷新功能妥妥的。 好了,今天的講解到此結束,有疑問的朋友請在下面留言。 源碼下載,請點擊這里

③ Android 中 ScrollView 如何實現類似 iPhone 中 UIScrollView 的分頁功能

1。你可以用ViewFlipper
來實現效果,每一張圖片為一頁,加上滑屏動畫效果,這個網上資料很全。2。你可以使用gallery來顯示圖片,這個跟ListView的使用方法是一樣的,網上資料和SDK文檔裡面都介紹很詳細。3。用手勢監聽需要給View上面實現OntouchListener,具體方法跟ViewFlipper的翻頁效果是一樣的

④ android textview如何分頁顯示

textview不能分頁的吧。。。據我所知,只能用scrollview

哦,那你這個想法……變數很大啊,因為你還要去分辨不同手機的屏幕解析度,來確定一個textview能顯示多少像素,來計算一屏幕能顯示多少字。。。

⑤ Android listview怎麼實現滾動分頁

通常這也分為兩種方式,一種是設置一個按鈕,用戶點擊即載入。另一種是當用戶滑動到底部時自動載入。今天我就和大家分享一下這個功能的實現。
首先,寫一個xml文件,moredata.xml,該文件即定義了放在listview底部的視圖:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Button
android:id="@+id/bt_load"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="載入更多數據" />
<ProgressBar
android:id="@+id/pg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:visibility="gone"
/>
</LinearLayout>

可以看到是一個按鈕和一個進度條。因為只做一個演示,這里簡單處理,通過設置控制項的visibility,未載入時顯示按鈕,載入時就顯示進度條。
寫一個item.xml,大家應該很熟悉了。用來定義listview的每個item的視圖。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<TextView
android:id="@+id/tv_title"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
/>
<TextView
android:textSize="12sp"
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
/>

</LinearLayout>

main.xml就不貼了,整個主界面就一個listview。
直接先看下Activity的代碼,在裡面實現分頁效果。

package com.notice.moredate;

import java.util.ArrayList;
import java.util.HashMap;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.Button;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.SimpleAdapter;
import android.widget.Toast;

public class MoreDateListActivity extends Activity implements OnScrollListener {

// ListView的Adapter
private SimpleAdapter mSimpleAdapter;
private ListView lv;
private Button bt;
private ProgressBar pg;
private ArrayList<HashMap<String,String>> list;
// ListView底部View
private View moreView;
private Handler handler;
// 設置一個最大的數據條數,超過即不再載入
private int MaxDateNum;
// 最後可見條目的索引
private int lastVisibleIndex;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

MaxDateNum = 22; // 設置最大數據條數

lv = (ListView) findViewById(R.id.lv);

// 實例化底部布局
moreView = getLayoutInflater().inflate(R.layout.moredate, null);

bt = (Button) moreView.findViewById(R.id.bt_load);
pg = (ProgressBar) moreView.findViewById(R.id.pg);
handler = new Handler();

// 用map來裝載數據,初始化10條數據
list = new ArrayList<HashMap<String,String>>();
for (int i = 0; i < 10; i++) {
HashMap<String, String> map = new HashMap<String, String>();
map.put("ItemTitle", "第" + i + "行標題");
map.put("ItemText", "第" + i + "行內容");
list.add(map);
}
// 實例化SimpleAdapter
mSimpleAdapter = new SimpleAdapter(this, list, R.layout.item,
new String[] { "ItemTitle", "ItemText" },
new int[] { R.id.tv_title, R.id.tv_content });
// 加上底部View,注意要放在setAdapter方法前
lv.addFooterView(moreView);
lv.setAdapter(mSimpleAdapter);
// 綁定監聽器
lv.setOnScrollListener(this);

bt.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
pg.setVisibility(View.VISIBLE);// 將進度條可見
bt.setVisibility(View.GONE);// 按鈕不可見

handler.postDelayed(new Runnable() {

@Override
public void run() {
loadMoreDate();// 載入更多數據
bt.setVisibility(View.VISIBLE);
pg.setVisibility(View.GONE);
mSimpleAdapter.notifyDataSetChanged();// 通知listView刷新數據
}

}, 2000);
}
});

}

private void loadMoreDate() {
int count = mSimpleAdapter.getCount();
if (count + 5 < MaxDateNum) {
// 每次載入5條
for (int i = count; i < count + 5; i++) {
HashMap<String, String> map = new HashMap<String, String>();
map.put("ItemTitle", "新增第" + i + "行標題");
map.put("ItemText", "新增第" + i + "行內容");
list.add(map);
}
} else {
// 數據已經不足5條
for (int i = count; i < MaxDateNum; i++) {
HashMap<String, String> map = new HashMap<String, String>();
map.put("ItemTitle", "新增第" + i + "行標題");
map.put("ItemText", "新增第" + i + "行內容");
list.add(map);
}
}

}

@Override
public void onScroll(AbsListView view, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
// 計算最後可見條目的索引
lastVisibleIndex = firstVisibleItem + visibleItemCount - 1;

// 所有的條目已經和最大條數相等,則移除底部的View
if (totalItemCount == MaxDateNum + 1) {
lv.removeFooterView(moreView);
Toast.makeText(this, "數據全部載入完成,沒有更多數據!", Toast.LENGTH_LONG).show();
}

}

@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
// 滑到底部後自動載入,判斷listview已經停止滾動並且最後可視的條目等於adapter的條目
if (scrollState == OnScrollListener.SCROLL_STATE_IDLE
&& lastVisibleIndex == mSimpleAdapter.getCount()) {
// 當滑到底部時自動載入
// pg.setVisibility(View.VISIBLE);
// bt.setVisibility(View.GONE);
// handler.postDelayed(new Runnable() {
//
// @Override
// public void run() {
// loadMoreDate();
// bt.setVisibility(View.VISIBLE);
// pg.setVisibility(View.GONE);
// mSimpleAdapter.notifyDataSetChanged();
// }
//
// }, 2000);

}

}

}

⑥ 怎樣實現android頁面滾動

除了嵌套滾動屬性的控制項外,比如ListView,WebView,EditText等外,想要讓某個頁面滾動,需要在布局中添加ScrollView控制項
一個ScrollView控制項只允許聲明一個子控制項
通常在一個ScrollView控制項中嵌套LinearLayout
如果當前布局沒有嵌套ScrollView,建議更改一下布局,實現滾動效果

⑦ android軟體開發怎樣實現分頁功能

ListView分頁:
(一)、目的:
Android 應用開發中,採用ListView組件來展示數據是很常用的功能,當一個應用要展現很多的數據時,一般情況下都不會把所有的數據一次就展示出來,而是通過 分頁的形式來展示數據,這樣會有更好的用戶體驗。因此,很多應用都是採用分批次載入的形式來獲取用戶所需的數據。例如:微博客戶端可能會在用戶滑 動至列表底端時自動載入下一頁數據,也可能在底部放置一個"查看更多"按鈕,用戶點擊後,載入下一頁數據。
(二)、核心技術點:
藉助 ListView組件的OnScrollListener監聽事件,去判斷何時該載入新數據;
往伺服器get傳遞表示頁碼的參數:page。而該page會每載入一屏數據後自動加一;
利用addAll()方法不斷往list集合末端添加新數據,使得適配器的數據源每新載入一屏數據就發生變化;
利用適配器對象的notifyDataSetChanged()方法。該方法的作用是通知適配器自己及與該數據有關的view,數據已經發生變動,要刷新自己、更新數據。

(三)、 OnScrollListener監聽事件 :
1、該監聽器中有兩個需要實現的方法:
onScrollStateChanged(AbsListView view, int scrollState):監聽屏幕的滾動狀態的變動情況
onScroll(AbsListView view, int firstVisibleItem,int visibleItemCount, int totalItemCount):監聽屏幕滾動的item的數量
2、 scrollState 回調順序如下:
第1次:scrollState = SCROLL_STATE_TOUCH_SCROLL(1):表示正在滾動。當屏幕滾動且用戶使用的觸碰或手指還在屏幕上時為1
第2次:scrollState =SCROLL_STATE_FLING(2) :表示手指做了拋的動作(手指離開屏幕前,用力滑了一下,屏幕產生慣性滑動)。
第3次:scrollState =SCROLL_STATE_IDLE(0) :表示屏幕已停止。屏幕停止滾動時為0。
3、 onScroll中參數講解:
firstVisibleItem:當前窗口中能看見的第一個列表項ID(從0開始)
visibleItemCount:當前窗口中能看見的列表項的個數(小半個也算)
totalItemCount:列表項的總數
4、思路:
當滾到最後一條,載入新數據;
適配器的數據源要進行累加:totalList.addAll(list);
數據發生變化,適配器通知:adapter.notifyDataSetChanged();【牢記】
判斷是否滾到最後一行。
(五)、核心代碼:

1、布局文件的核心代碼:

<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<ListView
android:id="@+id/listView_main"
android:layout_below="@+id/button_main_init"
android:layout_width="match_parent"
android:layout_height="match_parent">
</ListView>

<LinearLayout
android:id="@+id/layout_main_nextpage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#000"
android:visibility="invisible"
android:gravity="center"
android:onClick="clickButton"
android:padding="5dp">

<ProgressBar
android:id="@+id/progressBar_main"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<TextView
android:id="@+id/text_main_nextpage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:textSize="18sp"
android:onClick="clickButton"
android:textColor="#fff"
android:text="點擊載入更多數據"/>
</LinearLayout>

</RelativeLayout>
2、Activity頁面核心代碼:

publicclass MainActivity extends Activity {
privateStringTAG= "MainActivity";
privateListView listView_main;
privateLinearLayout layout_main_nextpage;

private MySQLiteDatabaseHelper dbHelper = null;

// 用於分頁顯示數據的屬性
privateintpageSize= 30;// 每頁顯示的條數
privateintcurPage= 1;
privateintrowCount= 0;
privateintpageCount= 0;// 總頁數

privatebooleanisBottom=false;// 判斷是否滾動到數據最後一條
private List<Map<String, Object>> totalList = null;// 載入到適配器中的數據源
private SimpleAdapter adapter = null;

@Override
protectedvoid onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

listView_main = (ListView) findViewById(R.id.listView_main);
layout_main_nextpage = (LinearLayout) findViewById(R.id.layout_main_nextpage);

// 實例化訪問資料庫幫助類
dbHelper = new MySQLiteDatabaseHelper();
// 獲取數據表一共有多少條,從而計算共有多少頁
rowCount=dbHelper.selectCount("select id from android_basic",null);
// 計算總頁碼數
pageCount = (int) Math.ceil(rowCount / (float) pageSize);

// 如果當前頁為第一頁,則數據源集合中就是第一頁的內容
if (curPage == 1) {
totalList = getCurpageList(1);
}
adapter = new SimpleAdapter(this, totalList,
R.layout.item_listview_main, new String[] { "_id", "title" },
newint[] { R.id.text_item_listview_id,
R.id.text_item_listview_title});
listView_main.setAdapter(adapter);

// 給ListView對象設置滾動監聽器,以此來判斷是否已經滾動到最後一條,從而決定是否載入新數據
listView_main.setOnScrollListener(new OnScrollListener() {
@Override
publicvoid onScrollStateChanged(AbsListView view, int scrollState) {
if (isBottom) {
// 如果滾到最後一條數據(即:屏幕最底端),則顯示:「載入更多新數據」
if(curPage < pageCount) {
layout_main_nextpage.setVisibility(View.VISIBLE);
}
} else {
layout_main_nextpage.setVisibility(View.GONE);
}
}

@Override
publicvoid onScroll(AbsListView view, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
// Log.i(TAG, "==" + firstVisibleItem + ":::" + visibleItemCount
// + ":::" + totalItemCount);
// 判斷是否已經滾動到了最後一條,從而決定是否提示載入新數據
isBottom = (firstVisibleItem + visibleItemCount == totalItemCount);
}
});
}

publicvoid clickButton(View view) {
switch (view.getId()) {
caseR.id.layout_main_nextpage:
// Log.i(TAG, "==" + curPage + ":::" + pageCount);
// 如果不是最後一頁,則讓當前頁碼累加,讓數據源累加新數據,並通知適配器信息發生變化
if(curPage < pageCount) {
curPage++;
totalList.addAll(getCurpageList(curPage));
adapter.notifyDataSetChanged();
}
// 只要點擊了提示「載入新數據」的信息,就讓其隱藏
layout_main_nextpage.setVisibility(View.GONE);
break;
default:
break;
}
}

// 獲取每一頁的數據,返回List集合
private List<Map<String, Object>> getCurpageList(int currentPage) {
int offset = (currentPage - 1) * pageSize;
String sql = "select id _id ,title from android_basic limit ? , ?";
returndbHelper.selectData(sql, new String[] { offset + "",
pageSize + "" });
}

}

⑧ Android listview怎麼實現滾動分頁

package com.test;

import android.app.ListActivity;
import android.os.Bundle;
import android.os.Handler;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.LinearLayout.LayoutParams;

public class test extends ListActivity implements OnScrollListener {
Aleph0 adapter = new Aleph0();
int lastItem = 0;
int mProgressStatus = 0;
private Handler mHandler = new Handler();
ProgressBar progressBar;

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LinearLayout searchLayout = new LinearLayout(this);
searchLayout.setOrientation(LinearLayout.HORIZONTAL);
progressBar = new ProgressBar(this);
progressBar.setPadding(0, 0, 15, 0);
searchLayout.addView(progressBar, new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
TextView textView = new TextView(this);
textView.setText("載入中...");
textView.setGravity(Gravity.CENTER_VERTICAL);
searchLayout.addView(textView, new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.FILL_PARENT));
searchLayout.setGravity(Gravity.CENTER);
LinearLayout loadingLayout = new LinearLayout(this);
loadingLayout.addView(searchLayout, new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
loadingLayout.setGravity(Gravity.CENTER);
getListView().addFooterView(loadingLayout);
// Start lengthy operation in a background thread
// new Thread(new Runnable() {
// public void run() {
// while (mProgressStatus < 100) {
//
// // Update the progress bar
// mHandler.post(new Runnable() {
// public void run() {
// progressBar.setProgress(mProgressStatus);
// }
// });
// }
// }
// }).start();
registerForContextMenu(getListView());
setListAdapter(adapter);
getListView().setOnScrollListener(this);
}

public void onScroll(AbsListView v, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
//lastItem = firstVisibleItem + visibleItemCount - 1;
//System.out.println("lastItem:" + lastItem);
}

public void onScrollStateChanged(AbsListView v, int state) {
// if (lastItem == adapter.count
// && state == OnScrollListener.SCROLL_STATE_IDLE) {
// adapter.count += 10;
// adapter.notifyDataSetChanged();
// }
if (state == OnScrollListener.SCROLL_STATE_IDLE) {

adapter.count += 10;

adapter.notifyDataSetChanged();

}
}

class Aleph0 extends BaseAdapter {
int count = 10;

public int getCount() {
return count;
}

public Object getItem(int pos) {
return pos;
}

public long getItemId(int pos) {
return pos;
}

public View getView(int pos, View v, ViewGroup p) {
TextView view = new TextView(test.this);
view.setText("entry " + pos);
view.setHeight(90);
return view;
}
}
}

閱讀全文

與android滾動分頁相關的資料

熱點內容
BL視頻APP 瀏覽:491
蕭九作品集txt 瀏覽:359
反應剛剛解放時期諜戰片 瀏覽:970
和美女被困隧道的七天 瀏覽:801
午夜影院入口。 瀏覽:845
韓國李彩潭所有電影大全 瀏覽:446
高精定位演算法縮寫 瀏覽:855
解壓試頻 瀏覽:494
有關蛇女香港的電影 瀏覽:67
兄妹禁忌之戀 瀏覽:348
文娛小說主角姓蘇 瀏覽:211
下載軟體佔用內存大需要解壓嗎 瀏覽:269
愛戀3d未刪減版百度雲網盤 瀏覽:48
安卓邊境怎麼玩 瀏覽:204
不用下載免費網址 瀏覽:187
gl片子 瀏覽:42
台灣電影男學生女老師 瀏覽:744
推薦個能看的網址你懂的 瀏覽:150
免費觀看歐美純愛電影 瀏覽:223
帶男朋友張浩回宿舍影片名字 瀏覽:178