文章詳情頁(yè)
android - 在RecyclerView布局使用CardView不能match_parent
瀏覽:276日期:2024-09-10 10:19:06
問(wèn)題描述

結(jié)果跑到程序里是這樣的::
不能定義寬高,不能讓它的寬match,怎么回事?
問(wèn)題解答
回答1:OnCreateViewholder里這么寫:Inflater.inflate(r.layout.xxx,container,false).
回答2:你的adapter,oncreateviewholder代碼貼出來(lái),看inflate的時(shí)候參數(shù)是3個(gè)不
回答3:看下你的recyclerview的寬度設(shè)置
回答4:之前遇過(guò),View view = LayoutInflater.from(MainActivity.this).inflate(R.layout.content_item,parent,false); 改成這樣綁定cardview就可以了,我是這么解決的,希望對(duì)你有沒(méi)有幫助http://m.blog.csdn.net/article/details?id=51108390
相關(guān)文章:
1. nignx - docker內(nèi)nginx 80端口被占用2. 關(guān)于docker下的nginx壓力測(cè)試3. docker容器呢SSH為什么連不通呢?4. docker - 各位電腦上有多少個(gè)容器?。咳萜饕欢?,自己都搞混了,咋辦呢?5. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””6. mac里的docker如何命令行開(kāi)啟呢?7. javascript - 連續(xù)點(diǎn)擊觸發(fā)mouseleave事件8. angular.js使用$resource服務(wù)把數(shù)據(jù)存入mongodb的問(wèn)題。9. macos - mac下docker如何設(shè)置代理10. docker gitlab 如何git clone?
排行榜

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