zoukankan      html  css  js  c++  java
  • 处理空列表

    <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));
        }
    }
  • 相关阅读:
    决策树分类
    集群服务器 获取COOKIE错误
    React 自写Loading
    HTB-靶机-Unattended
    HTB-靶机-LaCasaDePapel
    HTB-靶机-FriendZone
    HTB-靶机-CTF
    HTB-靶机-FluJab
    HTB-靶机-Help
    HTB-靶机-Chaos
  • 原文地址:https://www.cnblogs.com/androidsuperman/p/3684920.html
Copyright © 2011-2022 走看看