【问题标题】:Listview background issuesListview 后台问题
【发布时间】:2020-04-10 07:11:39
【问题描述】:

如何更改 Listview 的白色背景。 如果您拉入列表,您会看到白色背景,列表视图底部还有一个小白色边框。在Android中,我们没有那个我需要改变什么才能看不到那个白色边框?

详情见gif。 Android图片在gif下。 Listview的代码在底部。

<FlexboxLayout dock="center" class="menu-center" separatorColor="#1a0dab">
     <ListView for="(item, index) in languages" ref="listview" @itemTap="onItemTap" @itemLoading="onItemLoading">
             <v-template>
                 <FlexboxLayout class="element">
                     <Label class="top-text" :text="item.nameNative"></Label>
                 </FlexboxLayout>
             </v-template>
     </ListView>
</FlexboxLayout>


.menu-center{
        flex-direction: column;
    }

.menu-center .element{
        padding-top: 20%;
        flex-direction: column;
        align-items: center;
        background-color: #1a0dab;
}

【问题讨论】:

  • 尝试在 ListView 本身上设置背景颜色。
  • 谢谢,我为什么不尝试。我几乎尝试了除此之外的一切。非常感谢!

标签: ios listview nativescript nativescript-vue


【解决方案1】:

感谢@Manoj

ListView 本身添加背景颜色

<FlexboxLayout dock="center" class="menu-center" separatorColor="#1a0dab">
    <ListView for="(item, index) in languages" ref="listview" class="listView" @itemTap="onItemTap" @itemLoading="onItemLoading">
        <v-template>
            <FlexboxLayout class="element">
                <Label class="top-text" :text="item.nameNative"></Label>
            </FlexboxLayout>
        </v-template>
    </ListView>
</FlexboxLayout>

.menu-center .listView{
    background-color: #1a0dab;
}

【讨论】:

    猜你喜欢
    • 2010-12-09
    • 2013-12-19
    • 2012-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多