我需要将google登录集成到android xamarin应用程序中.通过以下链接的代码:http: //motzcod.es/post/67077106339/google-plus-services-login-and-1-in-xamarin-android
它显示错误连接失败,并且缺少[GooglePlayServicesUtil] Google Play商店.甚至还加入了谷歌播放服务(Froyo)组件.
即使我经历了波纹管链接 https://developers.google.com/+/mobile/android/sign-in
但这与使用java代码的android eclipse有关.任何人都可以建议我在xamarin中如何做到这一点.任何提示/链接表示赞赏.谢谢.
当我在应用程序中多次来回导航时,多次调用 MessagingCenter.Subscribe() 中编写的功能。但是每次订阅之前,我都会在构造函数中取消订阅相同的内容,如下所示,仍然没有用。
MessagingCenter.Unsubscribe<SubmitPage>(this,"Save");
MessagingCenter.Subscribe<SubmitPage>(this, "Save", (sender) =>
{
DisplayToastOnSuccessfulSubmission();
});
Run Code Online (Sandbox Code Playgroud)
在我的应用程序中,我有 6 页(git),我使用 MessagingCenter.Send 将数据保存在第 6 页,同样将在第 2 页订阅,保存的消息将显示在第 2 页(导航到该页面后)。
现在我像 2->1->2->3->4->5->6 那样导航,在这种特殊情况下 DisplayToastOnSuccessfulSubmission() 将被调用两次(因为 Page2 构造函数被调用两次)。
我什至尝试在 OnAppearing 中放置相同的代码。我无法在 OnDisappear 中取消订阅,因为我需要将事件连接到第 6 页进行保存。
在示例项目中重现相同的行为并在此处添加https://github.com/suchithm/MessageCenterSampleApp
Drop box 链接
这样做的正确方法是什么?
在我的xamarin表单项目中,我具有带有listview的屏幕,其中包含Entry和其他控件的数量。对于输入,我定义了针对text_changed,焦点和非焦点事件的功能。并且输入具有十进制键盘(仅接受十进制)。
问题:每当我尝试输入数字时,预期的行为是触发text_changed,但它也会触发两次unfocus和focus事件。
[输入text-> text_changed-> unfocus-> focus-> unfocus-> focus]。因此,我在各个事件中编写的所有逻辑都被改组并显示出奇怪的行为。
而且这一功能在iOS中可以正常工作,仅在Android中显示此问题。
码:
<DataTemplate x:Key="Numeric">
<ViewCell>
<ViewCell.View>
<StackLayout Padding="0">
<StackLayout Spacing="0" Padding="10">
<Grid ColumnSpacing="0" Padding="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<controls:CustomLabel Text="{Binding .Question}" Style="{StaticResource ListItemInspectionLabelStyleWordwrap}" HorizontalOptions="Start" VerticalOptions="Start" Grid.Row="0" Grid.Column="0" />
<controls:CustomEntry x:Name="InputEntry" IsEnabled="{Binding .CanRespond}" FontSize="12" TextChanged="OnNumericTextChanged" HeightRequest="50" Keyboard="Numeric" Focused="OnNumericFocus" Unfocused="OnNumericUnFocus" HorizontalOptions="FillAndExpand" VerticalOptions="End"
ClassId="{Binding .QuestionId}" Grid.Row="1" Grid.Column="0" />
<controls:ExtendedLabel x:Name="NumberHint" TextColor="#71797B" LineBreakMode="NoWrap" Text="{Binding NumericFieldTitle}" Style="{StaticResource ListItemInspectionLabelStyleWordwrap}"
HorizontalOptions="Start" VerticalOptions="Start" Grid.Row="2" Grid.Column="0" …Run Code Online (Sandbox Code Playgroud) 我有一个场景,我需要递归解压缩该文件夹.我已经浏览了几个链接但不符合我的要求.我正在使用mono 3.2.6并且需要在android xamarin中递归提取.
我使用了第三方工具ICSharpCode.SharpZipLib.Zip.这在我的调试模式应用程序中工作正常.但在发布模式下抛出错误.在真实设备中安装APK之后.
甚至尝试过Dotnet.Zip,但我无法递归解压缩文件夹. 这里建议开源dll,但它集中在文件而不是文件夹
另一个链接显示了java android中的解决方案,我在c#xamarin android中寻找相同的类型.有没有办法做到这一点,甚至免费的第三方工具都可以.任何人都可以建议我的解决方案或提示表示赞赏.
我想获取RelativeLayout.XConstraint一些平台特定的价值。我还想在 xaml 中使用 OnPlatform 关键字来执行此操作。我尝试过这个,但没有运气,
<RelativeLayout>
<RelativeLayout.XConstraint>
<OnPlatform x:TypeArguments="Constraint" Android="{ConstraintExpression Type=Constant,Constant=6" iOS="{ConstraintExpression Type=Constant,Constant=3}" />
</RelativeLayout.XConstraint>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
还尝试了这个https://forums.xamarin.com/discussion/57281/how-can-i-make-platform-specific-relativelayout-xconstraint-in-xaml但它显示异常“指定的约束包含无法解决的环形”。
x:TypeArguments这里的forRelativeLayout.XConstraint或任何其他方法是什么?期待对此的任何提示/建议。