【发布时间】:2018-06-16 21:30:30
【问题描述】:
我在 ViewCell 中有一个按钮...
<?xml version="1.0" encoding="UTF-8"?>
<ViewCell xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="ConnectionCrew.UI.Shared.Appointments.CompletionFormMain">
<ViewCell.View>
<Grid Margin="8, 16, 8, 16">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackLayout BackgroundColor="#bdbdbd" Padding="1">
<Editor x:Name="txtBxShiftNotes" BackgroundColor="White" Grid.Row="0" HeightRequest="100" />
</StackLayout>
<Button x:Name="btnSubmit" VerticalOptions="End" Grid.Row="1" HorizontalOptions="FillAndExpand" Text="Confirm Attendence" BackgroundColor="Lime" TextColor="White" HeightRequest="50" />
</Grid>
</ViewCell.View>
</ViewCell>
正在发生两件不受欢迎的事情。
1) 包含 ViewCell 的底部就在按钮文本的下方 - 就好像文本的基线与单元格的底部对齐。
2) 如果我点击按钮,它的点击事件不会触发并且整个单元格闪烁。除非我点击文本上方 - 在这种情况下没有闪烁并且引发点击事件。
如何解决这些问题?我更喜欢不闪烁、正确对齐和正确的命中测试。
【问题讨论】:
标签: xamarin.forms