文章詳情頁
android - 在RecyclerView布局使用CardView不能match_parent
瀏覽:106日期: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. python - 獲取到的數據生成新的mysql表2. javascript - js 對中文進行MD5加密和python結果不一樣。3. mysql里的大表用mycat做水平拆分,是不是要先手動分好,再配置mycat4. window下mysql中文亂碼怎么解決??5. sass - gem install compass 使用淘寶 Ruby 安裝失敗,出現 4046. python - (初學者)代碼運行不起來,求指導,謝謝!7. 為啥不用HBuilder?8. python - flask sqlalchemy signals 無法觸發9. python的文件讀寫問題?10. 為什么python中實例檢查推薦使用isinstance而不是type?
排行榜
