处理空列表
列表 处理
2023-09-14 08:59:01 时间
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ffe1e0de" > <ListView android:id="@+id/listview" android:layout_width="match_parent" android:layout_height="match_parent" > </ListView> <ImageView android:id="@+id/imageview" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/icon" /> </RelativeLayout>
java代码:
import com.example.test.Test1.R; import android.app.Activity; import android.os.Bundle; import android.widget.ListView; public class HelloAndroidActivity extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ListView listView = (ListView)findViewById(R.id.listview); listView.setEmptyView(findViewById(R.id.imageview)); } }
相关文章
- Python 编程骚操作连载(一)- 字符串、列表、字典和集合的处理(Part C)
- 【说站】python如何获取列表的长度
- 盘点一个Python列表处理的基础问题
- 表格,列表末尾数据删除后分页回退的处理
- transition-group列表过渡
- Vue指令之列表渲染
- odoo 给form表单视图内联列表添加按钮
- Python list列表添加元素的3种方法
- Jquery+Eayui实现列表选择功能详解编程语言
- 使用 Bash 脚本发送包含几天内到期的用户账号列表的电子邮件
- MySQL出现不在列表错误怎么办(mysql不在列表)
- 研究Redis跳跃列表的原理(redis跳跃列表原理)
- Js与下拉列表处理问题解决
- ExtJS4给Combobox设置列表中的默认值示例
- jQuery实现列表自动滚动循环滚动展示新闻