![](/img/trans.png)
[英]Button with Image with same height as UIElement in previous Grid.Column
[英]Can I adjust the height of the grid.column?
有什么方法可以調整xaml中grid.column的高度嗎?
我想創建一個具有寬屏幕(或文本框)的計算器,但是問題是當我使用grid.Columndefinitions時,它占用了整個頁面。 我想要的只是將列調整為第一行的底部。
是不可能的。 如果要這樣做,則需要調整Grid
本身的高度(例如,使用HeightRequest
或將其放置在某些布局中)。
如果我正確理解了這個問題,則您希望Grid從buttom網格行現在開始的地方開始。 為此,您可以在其后面放置一個stackPanel,並將網格放置在textBox下方。
像這樣的東西:
<StackPanel>
<TextBox Height="100"
Text="TextBox"
FontSize="70"
TextAlignment="Right"/>
<Grid Height="300">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
</Grid>
</StackPanel>
為了適應您的設計,需要進行一些調整,但是我希望這是您的初衷。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.