Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
喜欢这个效果(显示一半)是怎么实现的,我尝试使用 custom LinearLayoutManager,但是因为看不懂onMeasure方法而失败了。
LinearLayoutManager
onMeasure
我不确定我是否理解您的问题,但您可以尝试使用 LinearLayoutweightSum并将其分配layout_weight给子项。如果您正好有 2 个子项,您可以在各自的子项中分别提供weightSum2 和layout_weight1。还要确保layout_width为子项目设置为0dp。
weightSum
layout_weight
layout_width