android 开发技巧(13)--处理空列表
来源:互联网 发布:java窗口程序实例 编辑:程序博客网 时间:2024/05/22 10:53
android中ListView 用来展示数据,如果列表为空的状态,可以通过setEmpty(View)方法设置为空时显示的内容。
布局xml
<FrameLayout 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/my_list_view" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <ImageView android:id="@+id/empty_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/empty_view" /></FrameLayout>
代码:
public class Hack24Activity extends Activity { private ListView mListView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_hack24); mListView = (ListView) findViewById(R.id.my_list_view); mListView.setEmptyView(findViewById(R.id.empty_view)); }}
0 0
- android 开发技巧(13)--处理空列表
- 50个Android开发技巧(24 处理ListView数据为空的情况)
- android 处理空listview
- android处理空ListView
- Android开发技巧——使用RecyclerView实现分组列表
- 【Android应用开发技术:图像处理】章节列表
- android 批量处理列表
- Android字符串判空处理
- android列表为空时提示语
- Android选择本地联系人列表为空
- Android ListView等列表设置空布局
- Android应用开发之(图片处理技巧一)
- Android应用开发之(图片处理技巧一)
- Android应用开发之(图片处理技巧一)
- android图片处理技巧
- Android图片处理技巧
- Android图片处理技巧
- Android的开发语言Kotlin中对于空指针的处理
- iOS UIAppearance使用详解
- JSONModel的使用
- 入侵分析十诫
- xhEditor
- 蓝桥杯往届试题——芯片测试(数学问题)
- android 开发技巧(13)--处理空列表
- 日志分析工具traceView
- NSString的各种操作,拼接、搜索、截取
- 关于 iReport 的几个问题
- android 网站
- 云服务器配置
- eclipse出现Failed to load the JNI shared library
- 初学opengl(二)画散点图
- Python - access network