【c# – Xamarin Studio目标网标准】教程文章相关的互联网学习教程文章

c# – 我可以隐藏Xamarin.Auth NavigationBar吗?【代码】

有没有可能隐藏Xamarin.Auth NavigationBar? 我搜索了Xamarin论坛和其他许多人,但似乎没有人这样做过…… 对于身份验证,我遵循指南“Authenticating Users with Azure Mobile Apps”. 这是我目前的代码(在Android上):public async Task<bool> AuthenticateAsync () {...// The authentication provider could also be Facebook, Twitter, or Microsoftuser = await TodoItemManager.DefaultManager.CurrentClient.LoginAsync(thi...

c# – 我们可以在xamarin表单的标签页上添加内容吗?【代码】

我想在xamarin表单的标签页上面添加一些标签和图片,所以当我滑到另一个标签页时,标签页上面的内容将保持不变这里是设计 我可以实现这一点,因为我找不到任何参考吗?解决方法:如果要在选项卡页面上方添加标签,则无法在选项卡页面中添加标签,您必须创建自己的选项卡页面.您可以根据您的选择创建显示/隐藏的布局创建选项卡设计,并点击手势到选项卡并管理布局的显示/隐藏演示代码Xaml文件<!--Tab Design--> <StackLayout Orientation="...

c# – Xamarin Forms PCL中的LoadApplication出错【代码】

我创建了一个新的Xamarin Forms PCL解决方案,在调试模式下,我检查了Enable ProGuard选项,并选择了将comboxbox链接到Sdk和用户程序集.现在我在android上运行我的应用程序,之后它在MainActivity.cs类和在线显示我的错误LoadApplication(new App());错误:Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.我这样做是因为减少了我的发布应用程序的大小,我必须将发布模式更...

c# – 在Xamarin Native Android应用中显示admob横幅和插页式广告【代码】

我使用xamarin android native创建了一个应用程序. 现在我想在其中显示admob广告,包括横幅和广告间质性. 但我没有找到任何一步一步的好教程. 我发现很少,但它适用于xamarin.forms不适合原生. 所以任何人都可以给我链接,或者如果有人做过这种任务,请分享步骤,以便我可以整合它. 谢谢解决方法: using Android.Gms.Ads;...var adView = new AdView(Context); adView.AdUnitId = "ca-app-pub-3756076456456456/1111123234/app320x250";...

Xamarin Android:在C中将字符串从C#转换为Unicode字符串的正确方法是什么?【代码】

我正在编写一个Xamarin Android应用程序,并尝试编写Xamarin应用程序需要传递数据的C本机库.我需要将一个Unicode字符串传递给库,但是当我尝试时,我会遇到一些奇怪的行为. 在我的本机共享库中,我有以下代码:extern "C" void logANSI(const char* data) {__android_log_print(ANDROID_LOG_INFO, "StringMarshaling", "ANSI data: %s", data); }extern "C" void logUnicode(const wchar_t* data) {__android_log_print(ANDROID_LOG_IN...

c# – ContentView Xamarin Forms【代码】

我一般还在学习Xamarin Forms和C#.所以在我的MainPage.xaml中我有这个:<StackLayout><Button Text="bttn1" Clicked="Button_Clicked"/><Button Text="bttn2" Clicked="Button_Clicked_1"/><ContentView x:Name="DisplayCustomContentView"></ContentView></StackLayout>和两个ContentViews: 查看1:public class View1 : ContentView {public View1 (){Content = new StackLayout {Children = {new Label { Text = "View 1" },ne...

c# – 在IOS Xamarin中自动完成

我在MAC中的Xamarin IOS制作IOS应用程序.在工具栏中有文本框,但没有像Android工具栏中那样的自动完成字段.那么我有没有办法让文本框进入IOS Xamarin的自动完成字段并将其与JSON或数组连接.因为在Xamarin指南中没有ios中自动完成的示例或指南.解决方法:您可以将iOS texfeild与tableview一起使用以提供自动完成选项.您可以通过绑定JSON数据来检查我的博客条目http://appliedcodelog.com/2015/09/xamarinios-location-autocomplete-by...

c# – Xamarin.Android重新部署应用程序不会更新程序集【代码】

我正在使用多个测试设备进行开发 – Nexus 5和Nexus S. Nexus 5没有任何问题,但是S似乎有问题.protected override void OnCreate (Bundle bundle){base.OnCreate (bundle);SetContentView (Resource.Layout.Main);Button button = FindViewById<Button> (Resource.Id.myButton);button.Click += delegate{Authenticate();};}此代码在Nexus S上中断,它发现该按钮为null.因此,我假设它没有正确或足够快地生成我的布局. 我尝试添加一...

c# – Xamarin.Forms中的Application.Current Null异常【代码】

在Xamarin.Forms应用程序中,我使用Application.Current.Properties来保存设置.当我的LoginPage加载时,我想看看是否存在设置,但我得到一个异常,说Application.Current是Null.这是(已清理的)代码,它位于LoginPage中:private bool AuthTokenExists(){// The following line throws the exceptionif (Application.Current.Properties.ContainsKey("First") && Application.Current.Properties.ContainsKey("Second")){if (Application...

c# – 如何在表单xamarin中将开关设置为“on”(蓝色到绿色)时更改默认颜色.在ios默认它是GReen但在android中它是蓝色的【代码】

wirth这个代码当它“开启”时,我正在用蓝色开关.我想把它变成绿色.using Xamarin.Forms;namespace swithcasedemo {public class MyPage : ContentPage{public MyPage (){Content = new StackLayout { Children = {new Label { Text = "Hello ContentPage",HorizontalOptions=LayoutOptions.Center,VerticalOptions=LayoutOptions.CenterAndExpand},new Switch{HorizontalOptions=LayoutOptions.Center,VerticalOptions=LayoutOptio...

c# – 如何设置背景图像Xamarin Android【代码】

我想在后台项目Xamarin Android中放一个简单的图像…在我的项目中,我可以看到图像,但我建立的,不要在我的应用程序中显示.. 如你所见,我的背景图片调用hue.jpg,这是我的XML文件..<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:minWidth="25p...

c# – SetSupportActionBar在visual studio和Xamarin中崩溃了【代码】

我正在尝试使用Xamarin和Visual Studio创建一个Android应用程序.突然,我在使用SetSupportActionBar函数时遇到了一个奇怪的错误. 这是我的XML代码:<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"><...

c# – 如何在Xamarin iOS中创建垂直滚动视图【代码】

我是ios开发的新手.我正在尝试在Xamarin iOS应用程序中创建一个垂直ScrollView. 下面是我的水平ScrollView代码using System;using UIKit; using Foundation; using CoreGraphics; using System.Collections.Generic;namespace TestApp {public partial class ViewController : UIViewController{public ViewController (IntPtr handle) : base (handle){ScrollingButtonsController ();}UIScrollView scrollView;List<UIButton> bu...

c# – 无法正确部署应用程序Xamarin【代码】

我的android应用程序没有正确构建和部署.当启动一个新实例时,它会将我的应用程序启动到我的物理移动设备,我可以在Visual Studio中进行调试.但现在它不会将应用程序启动到移动设备,当我手动运行应用程序时,它不会在Visual Studio中进行调试.这个项目有可移植的类,并使用Xamarin.Forms. 我确实在AndroidManifest.xml上更改了我的Build Action. 我确实将文件位置更改为不包含符号或空格. 附件是现在的输出,之后什么都不做.此外,在我的...

c# – Xamarin.Forms属性未保存在Android版本中

我正在使用Xamarin.Forms和Application.Current.Properties来持久保存用户设置.我在Android上测试它,它工作正常 >在调试模式下>在发布模式下,链接器配置设置为无 但它不适用于仅设置为SDK Assemblies的链接器配置.我正在通过将APK文件直接部署到设备来进行测试.然后我尝试输入一些设置并重新启动应用程序 – 重启后所有设置都将丢失.我没有使用复杂的数据类型,只有字符串和bool. 我在这里找到了一个解决方法:https://forums.xamar...