【问题标题】:Android Leanback: Reduce rows spacing in RowsSupportFragmentAndroid Leanback:减少 RowsSupportFragment 中的行间距
【发布时间】:2021-06-22 10:34:23
【问题描述】:

我正在尝试使用 Leanback RowsSupportFragment 在 Android TV 中创建可选项目的垂直列表。这里的行之间似乎有一些默认间距,在附件中显示为黑色。我需要删除这个间距。我查看了一些 dimens 属性,但它们在全局设置间距,而我只在特定屏幕上需要它。如何做到这一点?

【问题讨论】:

    标签: android-tv leanback


    【解决方案1】:

    尝试使用 RowsSupportFragment 中 VerticalGridView 小部件的setVerticalMargin(或setItemMargin?)方法:

    getVerticalGridView().setVerticalMargin(25);
    

    【讨论】:

      猜你喜欢
      • 2023-01-22
      • 1970-01-01
      • 1970-01-01
      • 2015-04-29
      • 1970-01-01
      • 2021-06-30
      • 1970-01-01
      • 2012-02-24
      • 1970-01-01
      相关资源
      最近更新 更多