Wel*_*ing 4 c# xaml xamarin xamarin.forms
我有以下代码:
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" Margin="0,10,0,10" BackgroundColor="Green" Padding="5,5,5,5">
<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" Margin="0,0,0,0" BackgroundColor="Blue">
<Label Text="SHOW COMPLETED TASKS" BackgroundColor="Red" Style="{StaticResource lblSubHeading_Black}" />
</StackLayout>
<Switch x:Name="CompletedJobsSwitch" Toggled="CompletedJobsSwitch_Toggled" HorizontalOptions="EndAndExpand" IsToggled="{Binding isOn}" BackgroundColor="Yellow"/>
</StackLayout>
Run Code Online (Sandbox Code Playgroud)
这一切都很好加载,但当应用程序加载它显示,但Switch没有正确刷新.为什么?它真的很烦人,似乎真的不一致
我查看了http://forums.xamarin.com/discussion/21226/how-to-right-align-a-view-inside-a-list-item,但这对我不起作用.
有任何想法吗?
用这个
<Grid BackgroundColor="Green">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<Label Text="SHOW COMPLETED TASKS" BackgroundColor="Red" />
<Switch x:Name="CompletedJobsSwitch" BackgroundColor="Yellow" Grid.Column="1" />
</Grid>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3816 次 |
| 最近记录: |