首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >StackLayout透明色

StackLayout透明色
EN

Stack Overflow用户
提问于 2020-03-25 20:45:15
回答 1查看 129关注 0票数 0

我需要一些帮助,我想在UI底部的固定位置设置一个按钮,如何使用Xamarin.Forms做到这一点?我也想在StackLayout上设置透明的颜色,但没有运气。

代码语言:javascript
复制
<ScrollView>
    <StackLayout>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
        <Label Text="fds"/>
    </StackLayout>
</ScrollView>
<StackLayout BackgroundColor="LightBlue" Opacity="0.3" Orientation="Horizontal" VerticalOptions="End">
    <Button CornerRadius="30" HorizontalOptions="CenterAndExpand"  VerticalOptions="CenterAndExpand"/>
</StackLayout>

在预览器Image中,它是透明的。在电话Image

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-03-25 22:52:14

如果要在UI底部放置按钮,请使用grid

代码语言:javascript
复制
    <Grid Margin="10" >

        <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

        <StackLayout Grid.Row="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
        <ScrollView>
            <StackLayout>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
                <Label Text="fds"/>
            </StackLayout>
        </ScrollView>


    </StackLayout>

        <StackLayout Grid.Row="0" BackgroundColor="Transparent" HorizontalOptions="FillAndExpand" VerticalOptions="End">
        <Button CornerRadius="25" VerticalOptions="End" Margin="5,0,5,0" Text="Your Button" FontSize="Small" TextColor="White" BackgroundColor="#40db7093"></Button>
        </StackLayout>

    </Grid>

你可以在第一个堆栈布局中放置任何控件。

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

https://stackoverflow.com/questions/60849130

复制
相关文章

相似问题

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