文章詳情頁
android - 在RecyclerView布局使用CardView不能match_parent
瀏覽:274日期:2024-09-10 10:19:06
問題描述

結(jié)果跑到程序里是這樣的::
不能定義寬高,不能讓它的寬match,怎么回事?
問題解答
回答1:OnCreateViewholder里這么寫:Inflater.inflate(r.layout.xxx,container,false).
回答2:你的adapter,oncreateviewholder代碼貼出來,看inflate的時候參數(shù)是3個不
回答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. golang - 用IDE看docker源碼時的小問題2. html - css氣泡,實現(xiàn)“倒三角(不知道算不算三角了)”可透明的。3. phpstudy8.1沒集成mysql-front4. java - 如何點(diǎn)擊按鈕,重新運(yùn)行(我是初學(xué)者)?5. 運(yùn)行python程序時出現(xiàn)“應(yīng)用程序發(fā)生異常”的內(nèi)存錯誤?6. 我何時應(yīng)該在Java中使用JFrame.add(component)和JFrame.getContentPane()。add(component)7. 利用IPMI遠(yuǎn)程安裝centos報錯!8. 前端 - @media query 使用出現(xiàn)的問題?9. html5和Flash對抗是什么情況?10. javascript - 請指條明路,angular的$event,在select中卻是undefined?
排行榜

熱門標(biāo)簽
網(wǎng)公網(wǎng)安備