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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

Windows UWP开发系列 – RelativePanel

發(fā)布時間:2025/3/20 51 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Windows UWP开发系列 – RelativePanel 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

RelativePanel是在Windows 10 UWP程序中引入的一種新的布局面板,它是通過附加屬性設置元素間的位置關系來對實現(xiàn)布局的。一個簡單的示例如下:

<RelativePanel>
????<TextBox x:Name="textBox1" Text="textbox" Margin="5"/>
????<Button x:Name="blueButton" Margin="5" Background="LightBlue" Content="ButtonRight" RelativePanel.RightOf="textBox1"/>
????<Button x:Name="orangeButton" Margin="5" Background="Orange" Content="ButtonBelow" RelativePanel.RightOf="textBox1" RelativePanel.Below="blueButton"/>
</RelativePanel>

布局的效果如下:

????????

它支持如下幾種位置關系:

和其它元素相鄰:

  • LeftOf
  • RightOf
  • Above
  • Below

和其他元素邊緣對齊:

  • AlignBottomWith
  • AlignLeftWith
  • AlignTopWith
  • AlignRightWith

和其它元素中心對齊:

  • AlignHorizontalCenterWith
  • AlignVerticalCenterWith

和Panel邊緣對齊:

  • AlignBottomWithPanel
  • AlignLeftWithPanel
  • AlignRightWithPanel
  • AlignTopWithPanel

和Panel中心對齊:

  • AlignHorizontalCenterWithPanel
  • AlignVerticalCenterWithPanel

試用了一下,常用的對齊方式都有了,基本上各種復雜的布局都能輕易的實現(xiàn)。唯一的缺點是,這種布局方式和和其它元素耦合的,里面的元素不像其它的面板那樣可以隨意刪除。不過也非常強大了,比起之前WinRt下的那些布局面板要方便多了。

總結

以上是生活随笔為你收集整理的Windows UWP开发系列 – RelativePanel的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

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