第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

網(wǎng)格沒有使用所有可用空間

網(wǎng)格沒有使用所有可用空間

C#
寶慕林4294392 2021-11-14 14:54:57
幾周前我開始學(xué)習(xí) C# 以開發(fā) UWP 應(yīng)用程序。我正在關(guān)注 Bob Tabor 的教程“面向絕對初學(xué)者的 Windows 10 開發(fā)”。他在教學(xué)時(shí)提出挑戰(zhàn),因此我們應(yīng)用所學(xué)。在他的視頻中沒有。31、他提出了挑戰(zhàn)。我們的想法是制作一個(gè)看起來像這樣的應(yīng)用程序:在解決這個(gè)挑戰(zhàn)時(shí),我想出了這個(gè) mainpage.xaml。簡單介紹一下,頂部的黑色按鈕和底部的圖像位于 mainpage.xaml 中。還有一個(gè)框架,其中根據(jù)單擊的按鈕顯示不同的頁面。在主頁的構(gòu)造函數(shù)中,我導(dǎo)航到 donuts.xaml。這是我的主頁.xaml<Pagex:Class="Stupendous_Styles_Challenge.MainPage"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:local="using:Stupendous_Styles_Challenge"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"mc:Ignorable="d"Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"><Page.Resources>    <Style TargetType="Button" x:Key="myButtonStyle">        <Setter Property="Background" Value="Black" />        <Setter Property="Height" Value="100" />        <Setter Property="BorderThickness" Value="0, 0, 2, 0" />        <Setter Property="BorderBrush" Value="Gray" />        <Setter Property="HorizontalAlignment" Value="Stretch" />        <Setter Property="VerticalAlignment" Value="Stretch" />    </Style>    <Style TargetType="Image" x:Key="myIconStyle">        <Setter Property="Width" Value="50" />        <Setter Property="Height" Value="50" />        <Setter Property="Margin" Value="0, 0, 10, 0" />    </Style></Page.Resources><Grid>    <Grid.RowDefinitions>        <RowDefinition Height="100" />        <RowDefinition Height="*" />    </Grid.RowDefinitions>
查看完整描述

2 回答

?
滄海一幻覺

TA貢獻(xiàn)1824條經(jīng)驗(yàn) 獲得超5個(gè)贊

如果您明確設(shè)置頁面的寬度,它將永遠(yuǎn)不會(huì)拉伸:


刪除Width="600",或者您可以設(shè)置MinWidth="600"。


<Page

x:Class="Stupendous_Styles_Challenge.Donuts"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:local="using:Stupendous_Styles_Challenge"

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

mc:Ignorable="d"

Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" MinWidth="600">


<Page.Resources>

    <Style TargetType="TextBlock" x:Key="myTextBlockStyle">

        <Setter Property="FontSize" Value="24" />

        <Setter Property="Margin" Value="10, 0, 0, 0" />

    </Style>


查看完整回答
反對 回復(fù) 2021-11-14
?
楊魅力

TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超6個(gè)贊

我認(rèn)為這可能會(huì)解決問題,這是 donuts.xaml 的編輯版本:


<Page

x:Class="Stupendous_Styles_Challenge.Donuts"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:local="using:Stupendous_Styles_Challenge"

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

mc:Ignorable="d"

Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Width="600">


<Page.Resources>

    <Style TargetType="TextBlock" x:Key="myTextBlockStyle">

        <Setter Property="FontSize" Value="24" />

        <Setter Property="Margin" Value="10, 0, 0, 0" />

    </Style>


    <Style TargetType="Slider" x:Key="mySliderStyle">

        <Setter Property="Width" Value="200" />

        <Setter Property="VerticalAlignment" Value="Center"/>

        <Setter Property="Maximum" Value="24" />

        <Setter Property="Minimum" Value="0" />

        <Setter Property="HorizontalAlignment" Value="Stretch" />

    </Style>

</Page.Resources>


<Grid Background="Red" HorizontalAlignment="Stretch">

    <Grid.RowDefinitions>

        <RowDefinition Height="200"/>

        <RowDefinition />

    </Grid.RowDefinitions>


    <Grid.ColumnDefinitions>

        <ColumnDefinition Width="*"/>

    </Grid.ColumnDefinitions>


    <Image Source="Assets/white-logo.png" Height="200" Width="200" HorizontalAlignment="Left" VerticalAlignment="Top"/>


    <Grid Grid.Row="1">

        <Grid.RowDefinitions>

            <RowDefinition Height="40"/>

            <RowDefinition Height="40"/>

        </Grid.RowDefinitions>


        <Grid.ColumnDefinitions>

            <ColumnDefinition Width="*"/>

            <ColumnDefinition Width="*"/>

        </Grid.ColumnDefinitions>


        <TextBlock Text="Original Glazed Count: " Style="{StaticResource myTextBlockStyle}"/>

        <Slider Grid.Column="1" Style="{StaticResource mySliderStyle}" />


        <TextBlock Grid.Row="1" Text="Speedway Special Count: " Style="{StaticResource myTextBlockStyle}" />

        <Slider Grid.Column="1" Grid.Row="1" Style="{StaticResource mySliderStyle}" />

    </Grid>


</Grid> 


<Grid Background="Red" HorizontalAlignment="Stretch"> 

部分:


    <Grid.ColumnDefinitions>

        <ColumnDefinition Width="*"/>

    </Grid.ColumnDefinitions>

我認(rèn)為問題在于框架內(nèi)的網(wǎng)格沒有占用它可以獲得的空間并且具有固定的寬度,添加了 columndefinition 它確實(shí)占用了它所能占用的所有空間。


查看完整回答
反對 回復(fù) 2021-11-14
  • 2 回答
  • 0 關(guān)注
  • 185 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)