search

Home  >  Q&A  >  body text

android - 如何实现这样效果的GridView?

如图 外边框是有圆角的,内部item有分割线,而且是直角的。

ringa_leeringa_lee2876 days ago856

reply all(6)I'll reply

  • 迷茫

    迷茫2017-04-17 17:35:15

    It is recommended to use the RecyclerView,外面的样式可以自定义drawable设置background,至于里面的item分割线,可以使用RecyclerViewaddItemDecoration() method to achieve this.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 17:35:15

    Use a selector to set the background externally
    Then set the vertical spacing and horizontal spacing, and use the transparent part as the dividing line

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:35:15

    In the adapter’s getView(), replace the background for different position values

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 17:35:15

    Owner, has the effect been achieved? Please answer

    reply
    0
  • 黄舟

    黄舟2017-04-17 17:35:15

    The table uses recyclerview, and the background of recyclerview uses cardview

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 17:35:15

    I wrote two blogs on how to use RecyclerView+CardView, you can take a look http://liompei.com/2016/07/20...

    reply
    0
  • Cancelreply