【问题标题】:How to implement HorizontalAlignment="Stretch" in RelativePanel while creating Universal Windows Platforms 10 Apps?创建通用 Windows 平台 10 应用程序时如何在 RelativePanel 中实现 Horizo​​ntalAlignment="Stretch"?
【发布时间】:2015-12-28 01:58:26
【问题描述】:

我知道如何使用 Grid 和 StackPanel 来实现它,没有它可以在这里完成吗?

【问题讨论】:

    标签: windows uwp


    【解决方案1】:

    当然,只需将它与面板左右对齐!例如:

    水平拉伸

    <RelativePanel>
        <TextBox RelativePanel.AlignLeftWithPanel="True"
                 RelativePanel.AlignRightWithPanel="True" />
    </RelativePanel>
    

    如果你想垂直拉伸,做类似的事情,只需将顶部和底部与面板对齐:

    垂直拉伸

    <RelativePanel>
        <TextBox RelativePanel.AlignTopWithPanel="True"
                 RelativePanel.AlignBottomWithPanel="True" />
    </RelativePanel>
    

    【讨论】:

    • 我试图在同一个页面上添加这两个面板,但它们会相互重叠,在这种情况下应该怎么做?
    • 我试过了,给上面的 '' 名字,然后把他放在下面。
    • 它们可能重叠,因为它们在同一个面板中(例如网格),因此需要在该面板内正确排列。
    • 使用 gird 我做到了。
    • 知道如何动态地完成这项工作吗?其中内容是在运行时确定的。有什么解决方法吗?
    猜你喜欢
    • 1970-01-01
    • 2016-03-13
    • 2016-10-28
    • 2010-09-21
    • 1970-01-01
    • 2016-06-03
    • 2012-10-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多