Android studio ListView应用设计

一、添加ListView控件:

<ListView
    android:id="@+id/listView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    tools:layout_editor_absoluteX="1dp" />

二、类文件Country.java:

package com.july.listviewapp;

public class Country {
    private String name;
    private int icon;


    public Country(String name,int icon){
        this.name = name;
        this.icon = icon;
    }

    public String getName(){
        return name;
    }

    public void setName(String name){
        this.name = name;
    }

    public int getIcon(){
        return  icon;
    }

    public void setIcon(int icon){
        this.icon = icon;
    }

}

三、子布局文件:

<?xml version="1.0"

相关推荐

  1. Android studio SeekBar应用设计

    2024-01-10 15:40:04       58 阅读
  2. Android studio TabHost应用设计

    2024-01-10 15:40:04       60 阅读
  3. Android studio ListView应用设计

    2024-01-10 15:40:04       57 阅读
  4. Android studio GridView应用设计

    2024-01-10 15:40:04       62 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-10 15:40:04       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-10 15:40:04       100 阅读
  3. 在Django里面运行非项目文件

    2024-01-10 15:40:04       82 阅读
  4. Python语言-面向对象

    2024-01-10 15:40:04       91 阅读

热门阅读

  1. Flutter GetX 之 状态管理

    2024-01-10 15:40:04       56 阅读
  2. 如何彻底卸除Microsoft Edge浏览器

    2024-01-10 15:40:04       66 阅读
  3. LeetCode每日一题 | 2707. 字符串中的额外字符

    2024-01-10 15:40:04       65 阅读
  4. nodejs 服务端token 高效缓存验证

    2024-01-10 15:40:04       57 阅读
  5. 一种快速对32位/64位整数取模的方法

    2024-01-10 15:40:04       65 阅读
  6. HTML实战演练之比心

    2024-01-10 15:40:04       51 阅读
  7. Oracle19c文档 tnsnames.ora (三)

    2024-01-10 15:40:04       54 阅读