我想在随机十进制值后舍入该值
Example(round up when value > x.90):
18.25478 => 18
18.7545 => 18
18.90 => 19
18.95 = > 19
Run Code Online (Sandbox Code Playgroud)
我知道Math.ceil和Math.Floor方法,但我想结合一种方法.而且我还读到Math.floor和ceil很慢的值(我要在列表中转换3000.000+值!)
我怎样才能在JavaScript中执行此操作?
[Xamarin.Forms 2.5.0.91635] [Android 5,6,7,8]
我有一个页面,其中包含一个包含输入条目和标签的列表视图.我的问题是在Android中,点击第一个或第二个条目时,会出现键盘.我希望它向下滚动页面以选择最后一个条目,但我无法看到(或聚焦)最后一个条目,因为它与软键盘重叠.当软键盘启用/可见时,我无法滚动到最后一个条目,因为软键盘隐藏了最后一个键盘.当我隐藏/禁用软键盘时,我可以滚动到最后一个条目,但我不想要这个!
我在互联网上搜索并尝试了很多,但没有任何作用.
解决方案没有奏效: https://gist.github.com/jimmgarrido/e36033b26f01e8da091fd321d41d991a xamarinformscorner.blogspot.nl/2016/06/soft-keyboard-hiding-entries-fields-in.html HTTPS://forums.xamarin .COM /讨论/ 62668 /程序兼容性-不-不调整大小,屏幕与键盘
<ContentPage.Content>
<ScrollView>
<StackLayout x:Name="StackLayoutButtons" HorizontalOptions="Center" Orientation="Horizontal">
<Button x:Name="PreviousButton" WidthRequest="35" FontSize="23" FontAttributes="Bold" Clicked="PreviousButton_OnClicked"></Button>
<Button x:Name="DatePickerButton" FontSize="20" Clicked="DatePickerButton_OnClicked"></Button>
<DatePicker x:Name="DatePicker" Format="dddd d MMMM yyyy" VerticalOptions="Center" HorizontalOptions="FillAndExpand" IsVisible="False" IsEnabled="False"/>
<Button x:Name="NextButton" WidthRequest="35" FontSize="23" FontAttributes="Bold" Clicked="NextButton_OnClicked"></Button>
<Button x:Name="LastButton" WidthRequest="50" FontSize="23" FontAttributes="Bold" Clicked="LastButton_OnClicked"></Button>
</StackLayout>
<ListView x:Name="ListViewItemPage" ItemTapped="ListView_OnItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<RelativeLayout x:Name="RelativeLayout" >
<Label x:Name="DescriptionLabel" Text="{Binding Description}" RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Y, Factor=0, Constant=15}" RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=X, Factor=0, Constant=15}" />
<Entry x:Name="Entry" …Run Code Online (Sandbox Code Playgroud)