android分页处理-3
16lz
2021-12-04
xml:list_items.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">
<TextView android:id="@+id/newstitle" android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:id="@+id/newscontent" android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
loadmore.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<Button android:id="@+id/loadMoreButton" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="查看更多..." />
</LinearLayout>
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">
<ListView android:id="@+id/lvNews" android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
model:News
public class News
{
/*
* 新闻标题
*/
private String title;
/*
* 新闻内容
*/
private String content;
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">
<TextView android:id="@+id/newstitle" android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:id="@+id/newscontent" android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
loadmore.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<Button android:id="@+id/loadMoreButton" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="查看更多..." />
</LinearLayout>
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">
<ListView android:id="@+id/lvNews" android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
model:News
public class News
{
/*
* 新闻标题
*/
private String title;
/*
* 新闻内容
*/
private String content;
}
更多相关文章
- android studio调整默认的debug.keystore位置。
- android 读取raw文件下文件内容
- Android(安卓)文件的保存与读取之SDCard(SD卡)存储
- Android4.4支持使用DevTools对原生Android应用程序WebViews内容
- Develop--Training(一)Getting Started
- Android中使用log4j输出log内容到sd卡
- Android(安卓)Tab 选项卡的简单实现
- Android4.4支持使用DevTools对原生Android应用程序WebViews内容
- Android(安卓)文件的保存与读取之自带储存空间