【问题标题】:Listview android paddingListview android填充
【发布时间】:2019-11-05 09:51:56
【问题描述】:

是否可以在 Android 上以某种方式禁用 ListView 中的填充?在 iOS 上一切都很好,没有填充。在 Android 上,您可以看到标签周围的填充。

有问题的测试游乐场https://play.nativescript.org/?template=play-ng&id=sdr0VD

【问题讨论】:

  • 您使用的是哪个 tns 版本?我用 tns@6.1.2 和 android 9 测试了你的代码,没有发现这个错误。
  • 是的,有可能,请分享您的代码,以便我们查看您的代码问题或您需要添加的内容。

标签: android nativescript nativescript-angular nativescript-telerik-ui


【解决方案1】:

这似乎是主题 v2.2.0 的问题(截至今天最新),删除核心主题应该可以解决问题。另一种解决方法是,

第 1 步:用 GridLayout 包裹标签

    <ng-template nsTemplateKey="heading" let-item="item">
        <GridLayout>
            <Label text="Test text" class="heading"></Label>
        </GridLayout>
    </ng-template>

第 2 步:在 CSS 下方添加

ListView > * {
    padding:  0;
}

【讨论】:

    猜你喜欢
    • 2023-03-08
    • 2015-06-28
    • 1970-01-01
    • 2018-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多