容器控件StackPanel控件-創(chuàng)新互聯(lián)

StackPanel控件也是用于布局的,可以使多個(gè)子控件按橫向或者縱向排列,并且可以根據(jù)自身大  小拉伸子控件。

創(chuàng)新互聯(lián)專注于清河門網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠為您提供清河門營銷型網(wǎng)站建設(shè),清河門網(wǎng)站制作、清河門網(wǎng)頁設(shè)計(jì)、清河門網(wǎng)站官網(wǎng)定制、成都微信小程序服務(wù),打造清河門網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供清河門網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。

 StackPanel默認(rèn)情況下為縱向排列,當(dāng)Orientation設(shè)置為Horizontal時(shí),橫向排列。

 StackPanel-堆放容器 將子元素排列成一行(可沿水平或垂直方向)。

 StackPanel的規(guī)則是:根據(jù)附加屬性,我要么讓元素橫著排列,要么豎著排列。

 StackPanel 為啟用布局的 Panel 元素之一。在特定情形下,例如,要將一組對象排列在豎直或  水平列表(例如,項(xiàng)的水平或豎直菜單)中,StackPanel 很有用。設(shè)置 Orientation 屬性可確  定列表的方向。Orientation 屬性的默認(rèn)值為 Vertical。

 StackPanel 中內(nèi)容的 HorizontalAlignment 和 VerticalAlignment 默認(rèn)值均為 Stretch。

 附上代碼:

  1. <!--LayoutRoot 是包含所有頁面內(nèi)容的根網(wǎng)格-->
  2. <Gridx:Name"LayoutRoot"Background"Transparent">
  3. <StackPanelOrientation"Vertical">
  4. <ButtonContent"元素1"></Button>
  5. <ButtonContent"元素2"></Button>
  6. <ButtonContent"元素3"></Button>
  7. </StackPanel>
  8. </Grid>

 效果為:

 容器控件StackPanel控件

 附上代碼:

  1. <!--LayoutRoot 是包含所有頁面內(nèi)容的根網(wǎng)格-->
  2. <Gridx:Name"LayoutRoot"Background"Transparent">
  3. <StackPanelOrientation"Horizontal">
  4. <ButtonContent"元素1"></Button>
  5. <ButtonContent"元素2"></Button>
  6. <ButtonContent"元素3"></Button>
  7. </StackPanel>
  8. </Grid>

 效果為:

 容器控件StackPanel控件

 示例二:

  1. <!--LayoutRoot contains the root grid where all other page content is placed-->
  2. <Gridx:Name"LayoutRoot"Background"Transparent">
  3. <Grid.RowDefinitions>
  4. <RowDefinitionHeight"Auto"/>
  5. <RowDefinitionHeight"*"/>
  6. </Grid.RowDefinitions>
  7. <!--TitlePanel contains the name of the application and page title-->
  8. <StackPanelx:Name"TitlePanel"Grid.Row"0"Margin"12,17,0,28">
  9. <TextBlockx:Name"ApplicationTitle"Text"STACKPANEL WITH FOUR ELEMENTS"Style"{StaticResource PhoneTextNormalStyle}"/>
  10. </StackPanel>
  11. <!--ContentPanel - place additional content here-->
  12. <Gridx:Name"ContentPanel"Grid.Row"1"Margin"12,0,12,0">
  13. <StackPanelName"stackPanel"Orientation"Vertical">
  14. <TextBlockText"TextBlock aligned at right bottom"
  15. HorizontalAlignment"Right"
  16. VerticalAlignment"Bottom"/>
  17. <ImageName"p_w_picpath2"Source"/PhoneApp2;component/Images/1-12101Q43P9.jpg"/>
  18. <EllipseStroke"{StaticResource PhoneAccentBrush}"
  19. StrokeThickness"12"/>
  20. <TextBlockText"TextBlock aligned at left top"
  21. HorizontalAlignment"Left"
  22. VerticalAlignment"Top"/>
  23. </StackPanel>
  24. </Grid>
  25. </Grid>

 效果圖為:

 容器控件StackPanel控件

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

分享文章:容器控件StackPanel控件-創(chuàng)新互聯(lián)
網(wǎng)頁地址:http://bm7419.com/article24/dsdice.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)、網(wǎng)站導(dǎo)航、網(wǎng)站設(shè)計(jì)做網(wǎng)站、網(wǎng)站改版網(wǎng)站策劃

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設(shè)