文章詳情頁
android - 在RecyclerView布局使用CardView不能match_parent
瀏覽:189日期:2024-09-10 10:19:06
問題描述
結果跑到程序里是這樣的::
不能定義寬高,不能讓它的寬match,怎么回事?
問題解答
回答1:OnCreateViewholder里這么寫:Inflater.inflate(r.layout.xxx,container,false).
回答2:你的adapter,oncreateviewholder代碼貼出來,看inflate的時候參數是3個不
回答3:看下你的recyclerview的寬度設置
回答4:之前遇過,View view = LayoutInflater.from(MainActivity.this).inflate(R.layout.content_item,parent,false); 改成這樣綁定cardview就可以了,我是這么解決的,希望對你有沒有幫助http://m.blog.csdn.net/article/details?id=51108390
相關文章:
1. android - weex 項目createInstanceReferenceError: Vue is not defined2. javascript - 如圖,百度首頁,查看源代碼為什么什么都沒有?3. 網頁爬蟲 - python requests爬蟲,如何post payload4. html - 關于CSS實現border的0.5px設置?5. PHPExcel表格導入數據庫怎么導入6. android - 哪位大神知道java后臺的api接口的對象傳到前端后輸入日期報錯,是什么情況?求大神指點7. pdo 寫入到數據庫的內容為中文的時候寫入亂碼8. PHP類封裝的插入數據,總是插入不成功,返回false;9. vue2.0+webpack 如何使用bootstrap?10. mac連接阿里云docker集群,已經卡了2天了,求問?
排行榜
