日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

Windows10开发手记-RelativePanel使用详解

發(fā)布時間:2025/3/13 windows 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Windows10开发手记-RelativePanel使用详解 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

Windows 10已于7月29號面向全球發(fā)布,同時Universal Windows Platform(UWP) SDK也已正式放出,配合VS 2015我們可以開發(fā)出通用的Windows App。

在Windows 10 SDK中,新增和改變了很多特性,其中用于適配的新控件RelativePanel將會成為我們開發(fā)中最常用的Windows 10組件。

布局示例

代碼示例:

?

<RelativePanel BorderBrush="Gray" BorderThickness="10"><Rectangle x:Name="RedRect" Fill="Red" MinHeight="100" MinWidth="100"/><Rectangle x:Name="BlueRect" Fill="Blue" MinHeight="100" MinWidth="100" RelativePanel.RightOf="RedRect" /><!-- Width is not set on the green and yellow rectangles.It's determined by the RelativePanel properties. --><Rectangle x:Name="GreenRect" Fill="Green" MinHeight="100" Margin="0,5,0,0" RelativePanel.Below="RedRect" RelativePanel.AlignLeftWith="RedRect" RelativePanel.AlignRightWith="BlueRect"/><Rectangle Fill="Yellow" MinHeight="100" RelativePanel.Below="GreenRect" RelativePanel.AlignLeftWith="BlueRect" RelativePanel.AlignRightWithPanel="True"/> </RelativePanel>

?

特性詳解:

?

開發(fā)中我們主要使用RelativePanel作為容器,使用RelativePanel的附加屬性對其內(nèi)容進行布局,例如RightOf、Above等,用法與Grid的附加屬性類似。同時這些附加屬性與iOS中新特性AutoLayout的約束很像,下面是對其附加屬性詳細解釋。

?

? 用法描述

RelativePanel.Above

設置當前element為目標element的上方

RelativePanel.AlignBottomWith

設置當前element與目標element底部對齊

RelativePanel.AlignBottomWithPanel

設置當前element與RelativePanel底部對齊

RelativePanel.AlignHorizontalCenterWith

設置當前element與目標element水平中心對齊

RelativePanel.AlignHorizontalCenterWithPanel

設置當前element與RelativePanel水平中心對齊

RelativePanel.AlignLeftWith

設置當前element與目標element左邊框?qū)R

RelativePanel.AlignLeftWithPanel

設置當前element與RelativePanel左邊框?qū)R

RelativePanel.AlignRightWith

設置當前element與目標element右邊框?qū)R

RelativePanel.AlignRightWithPanel

設置當前element與RelativePanel右邊框?qū)R

RelativePanel.AlignTopWith

設置當前element與目標element頂部對齊

RelativePanel.AlignTopWithPanel

設置當前element與RelativePanel頂部對齊

RelativePanel.AlignVerticalCenterWith

設置當前element與目標element垂直中心對齊

RelativePanel.AlignVerticalCenterWithPanel

設置當前element與RelativePanel垂直中心對齊

RelativePanel.Below

設置當前element為目標element的下方

RelativePanel.LeftOf

設置當前element為目標element的左邊

RelativePanel.RightOf

設置當前element為目標element的右邊

?

總結(jié)

?

RelativePanel能夠?qū)崿F(xiàn)幾乎所有針對布局的約束,能夠滿足各種布局需求,配合VisualStateTrigger能夠較完美的視線響應式的UI,滿足Windows 10設想的小至IoT設備大至80寸Hub的應用情景。

?

轉(zhuǎn)載于:https://www.cnblogs.com/mantgh/p/4702007.html

總結(jié)

以上是生活随笔為你收集整理的Windows10开发手记-RelativePanel使用详解的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。