android - 如何RecyclerView的item寬度設置
問題描述
item的布局:
<LinearLayout xmlns:android='http://schemas.android.com/apk/res/android' android:layout_width='match_parent' android:layout_height='wrap_content' android:orientation='vertical'> <android.support.v7.widget.AppCompatButtonandroid:layout_height='wrap_content'android:text='Text'android: android:layout_width='match_parent'/></LinearLayout>
RecyclerView:
<android.support.v7.widget.RecyclerViewandroid: android:layout_width='match_parent'android:layout_height='match_parent'android:scrollbars='vertical'/>
運行截圖:
求解。。。。
還有一個問題為什么AppCompatButton本來是小寫問什么運行成大寫了。。
問題解答
回答1:大小寫問題需要設置下屬性android:textAllCaps為false
回答2:看下你的onCreateViewHolder
相關文章:
1. 致命錯誤: Class ’appfacadeTest’ not found2. html5 - 如何實現帶陰影的不規則容器?3. objective-c - iOS開發支付寶和微信支付完成為什么跳轉到了之前開發的一個app?4. css - 移動端字體設置問題5. python - 管道符和ssh傳文件6. javascript - 循環嵌套多個promise應該如何實現?7. mysql優化 - 關于mysql分區8. 請教各位大佬,瀏覽器點 提交實例為什么沒有反應9. 前端 - IE9 css兼容問題10. javascript - ionic2 input autofocus 電腦成功,iOS手機鍵盤不彈出
