文章詳情頁
android - 在RecyclerView布局使用CardView不能match_parent
瀏覽:120日期:2024-09-10 10:19:06
問題描述
結(jié)果跑到程序里是這樣的::
不能定義寬高,不能讓它的寬match,怎么回事?
問題解答
回答1:OnCreateViewholder里這么寫:Inflater.inflate(r.layout.xxx,container,false).
回答2:你的adapter,oncreateviewholder代碼貼出來,看inflate的時(shí)候參數(shù)是3個(gè)不
回答3:看下你的recyclerview的寬度設(shè)置
回答4:之前遇過,View view = LayoutInflater.from(MainActivity.this).inflate(R.layout.content_item,parent,false); 改成這樣綁定cardview就可以了,我是這么解決的,希望對你有沒有幫助http://m.blog.csdn.net/article/details?id=51108390
相關(guān)文章:
1. javascript - node.js promise沒用2. node.js - nodejs如何發(fā)送請求excel文件并下載3. 為什么我ping不通我的docker容器呢???4. docker-machine添加一個(gè)已有的docker主機(jī)問題5. golang - 用IDE看docker源碼時(shí)的小問題6. java - 我在用Struts2上傳文件時(shí),報(bào)以下錯(cuò)誤怎么回事?7. android 如何實(shí)現(xiàn)如圖中的鍵盤上的公式及edittext的內(nèi)容展示呢8. mysql - 求SQL語句9. MySQL如何實(shí)現(xiàn)表中再嵌套一個(gè)表?10. PHP注冊功能
排行榜

熱門標(biāo)簽