如何强制 Xamarin Forms iOS 标签匹配其父滚动视图的高度?

问题描述 投票:0回答:1
ios xamarin xamarin.forms label scrollview
1个回答
0
投票

不用Label给ScrollView提供背景色,你可以直接设置ScrollView的

BackgroundColor
来实现你想要的(前提是我正确理解你的需求):

<ScrollView
    BackgroundColor="Blue"
    Grid.Row="1"
    Margin="0,4"
    Padding="0,4"
    VerticalOptions="Fill"
    Scrolled="sv_Scrolled">

    <Label
        x:Name="label"
        TextType="Html"
        Margin="16,0"
        Padding="30,4"
        LineBreakMode="WordWrap"
        VerticalOptions="Fill"/>

</ScrollView>
© www.soinside.com 2019 - 2024. All rights reserved.