📌  相关文章
📜  水平recyclerview项目宽度一半的屏幕android - Java代码示例

📅  最后修改于: 2022-03-11 14:52:40.913000             🧑  作者: Mango

代码示例2
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
        val view = LayoutInflater.from(context).inflate(R.layout.row, parent, false);
        view.layoutParams = ViewGroup.LayoutParams((parent.width * 0.5).toInt(),ViewGroup.LayoutParams.MATCH_PARENT)
        return ViewHolder(view);
    }