本文实例为大家分享了CheckBox全选、反选、单选的具体代码,供大家参考,具体内容如下MainActiivitypackage com.bwie.day06;import Android.support.v7.app.AppCompatA
本文实例为大家分享了CheckBox全选、反选、单选的具体代码,供大家参考,具体内容如下
MainActiivity
package com.bwie.day06;import Android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.support.v7.widget.LinearLayoutManager;import android.support.v7.widget.RecyclerView;import android.view.View;import com.bwie.day06.myadapter.MyAdapter;public class MainActivity extends AppCompatActivity { private MyAdapter myAdapter; private LinearLayoutManager linearLayoutManager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //初始化控件 RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerview); //在加载数据之前配置 linearLayoutManager = new LinearLayoutManager(this); recyclerView.setLayoutManager(linearLayoutManager); //创建一个适配器 myAdapter = new MyAdapter(); recyclerView.setAdapter(myAdapter); } public void btnAll(View view) { myAdapter.All(); } public void btnner(View view) { myAdapter.neverall(); }}
--结束END--
本文标题: Android RecycleView使用(CheckBox全选、反选、单选)
本文链接: https://lsjlt.com/news/221224.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0