首页 > 解决方案 > Listview 后台问题

问题描述

如何更改 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;
}

标签: ioslistviewnativescriptnativescript-vue

解决方案


感谢@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;
}


推荐阅读