RecyclerView使用Switchcompat not displaying the Switch

来源:互联网 发布:pubmed数据库 编辑:程序博客网 时间:2024/06/05 08:48

在RecyclerView中使用Switchcompat不显示图标或文字

解决方案:
始化适配器时,如果是使用getApplicationContext()获取上下文,则会出现这样的问题。我们只需改为this获取上下文即可,如MyActivity.this

https://stackoverflow.com/questions/26563986/switchcompat-not-displaying-the-switch

原创粉丝点击