首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Xamarin表单:如何将列表视图放在图像的顶部?

Xamarin表单:如何将列表视图放在图像的顶部?
EN

Stack Overflow用户
提问于 2020-04-07 06:18:40
回答 2查看 68关注 0票数 0

我在我的项目上有一个flowlistview,我需要把它放在图像上。以下是我的XAML代码:

代码语言:javascript
运行
复制
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <Image Aspect="AspectFill" HorizontalOptions="FillAndExpand" Grid.Row="0" Source="ic_background_image_xx.png"/>

    <flv:FlowListView 
        Grid.Row="0">
        <flv:FlowListView.FlowColumnTemplate>
            <DataTemplate>
                <StackLayout> 

                </StackLayout>
            </DataTemplate>
        </flv:FlowListView.FlowColumnTemplate>
    </flv:FlowListView>
</Grid>

这段代码在android设备上运行良好,listview放在绿色背景图像之上。,但在ios中,这个功能不起作用。请浏览下面的屏幕截图,并为ios提供一个解决方案。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-04-07 07:20:56

原因: ListView in iOS有一个默认的BackgroundColor (White),而在Android中,ListView的背景色是透明的。

因此,您只需将BackgroundColor of FlowListView设置为透明即可。

代码语言:javascript
运行
复制
<flv:FlowListView   
        BackgroundColor="Transparent"
        Grid.Row="0">
票数 1
EN

Stack Overflow用户

发布于 2020-04-07 06:36:06

为此,您需要为图像设置Grid.RowSpan="2"

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61073878

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档