如何在Xamarin Froms中使用c#在Android和iOS中获取设备唯一ID?我使用Azure Notification Hub发送通知.我指的是这个博客.但在Android中我无法找到相关的"设置"
xamarin.ios xamarin.android azure-notificationhub xamarin.forms deviceid
我已经开发了一个应用程序,并在Xamarin Forms PCL项目中构建了用于Ad-Hoc测试的APK和IPA。
现在,Android大小应用程序为76.5 MB,而Iphone应用程序大小仅为34.5 MB。为什么?
这个主要的应用大小差异背后的原因是什么?
谢谢。
我正在使用自定义单元格创建 Listview。我在 Viewcell 中使用 Frame。它在 Android 设备中显示良好,但在 IOS 中它不显示两帧之间的边距。我如何为 IOS 设置这个?
Viewcell的代码是:
<ViewCell>
<StackLayout>
<Frame Margin="10" BackgroundColor="White" CornerRadius="5" HasShadow="False" IsClippedToBounds="False">
<StackLayout>
<Label Text="{Binding Name}" FontFamily="Raleway-Regular" FontSize="24" TextColor="#262628" HorizontalTextAlignment="Center" FontAttributes="Bold"></Label>
<Label Text="{Binding Description1}" FontSize="15" HorizontalTextAlignment="Center" TextColor="#262628" FontAttributes="Bold" Margin="0,5"></Label>
<ContentView HorizontalOptions="Center" Padding="0" Content="{Binding IngredientsArray1, Converter={StaticResource arrayToStackLayout}}" />
</StackLayout>
</Frame>
</StackLayout>
</ViewCell>
Run Code Online (Sandbox Code Playgroud)
IOS 输出是:
我正在使用 Google API .Net 客户端库在 .Net 中使用 Google Drive API 创建应用程序。
在该列表中,请求从根文件夹以及子文件夹和共享文件中获取所有文件。我不想一一列举。我想要仅在根文件夹中可用的文件列表,而不是从子文件夹中可用的文件列表。这怎么可能?
我的代码如下:
FilesResource.ListRequest listRequest = service.Files.List();
var files = listRequest.Execute();
Run Code Online (Sandbox Code Playgroud)
为此,我将范围定义为
var Scopes = { DriveService.Scope.Drive };
Run Code Online (Sandbox Code Playgroud) 我正在使用“ Plugin.Media.CrossPlatform” nuget来访问Camera并以Xamarin Forms形式拍照。但目前,它一次只能拍摄一张照片,并且仅上传最后拍摄的照片。我想添加多个捕获,并允许用户从最近捕获的图像中选择特定的图片。Android和IOS两个平台中的此插件怎么可能?
另外,我还添加了选择模式,如果用户想从图库中选择图片。但是,存在相同的问题。我想一次选择多个图像,然后在两个平台上将其上传。Xamarin Forms中的工具如何?是否有用于此任务的示例或博客?
我正在使用这个包裹。
我有设计一页,但它看起来不像要求.我是Xamarin的新手,我不知道如何设计像附加图像.
我的代码是
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="*"/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Label Text="From" Font="20" Grid.Row="0" Grid.Column="0"></Label>
<Entry x:Name="txtFrom" HorizontalOptions="FillAndExpand" Grid.Row="0" Grid.Column="1" ></Entry>
<Label Text="To" Font="20" Grid.Row="1" Grid.Column="0"></Label>
<Entry x:Name="txtTo" Grid.Row="1" Grid.Column="1" HorizontalOptions="FillAndExpand"></Entry>
<Label Text="Subject" Font="20" Grid.Column="0" Grid.Row="2"></Label>
<Entry x:Name="txtSubject" HorizontalOptions="FillAndExpand" Grid.Column="1" Grid.Row="2"></Entry>
<Label Text="Body" Font="20" Grid.Column="0" Grid.Row="3"></Label>
<Editor x:Name="txtBody" HeightRequest="100" Grid.Row="4" Grid.ColumnSpan="2"></Editor>
<Button x:Name="btnSend" Text="Send" BackgroundColor="Orange" Grid.Row="5" Grid.ColumnSpan="2"></Button>
</Grid>
Run Code Online (Sandbox Code Playgroud)
我正在 Xamarin.Forms 中开发跨平台应用程序。我使用过框架、标签和按钮控件。按钮显示完美,但标签不显示框架内的文本。
屏幕截图是
我也想将按钮更改为圆角。怎么可能?
如何更改底部导航栏颜色和 textColor?
我正在使用 BottomNavigationBar.XF 插件。
我的代码是:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="DhirenBhai_sApp.Views.StoresPage" Title="Stores">
<ContentPage.Content>
<StackLayout>
<StackLayout VerticalOptions="Start" BackgroundColor="LawnGreen" HeightRequest="40">
<Label Text="Stores" TextColor="White" VerticalOptions="Center" HorizontalOptions="Center" FontSize="Large" />
</StackLayout>
<Frame VerticalOptions="FillAndExpand" Margin="10" BackgroundColor="Transparent" Padding="5" >
<Label TextColor="Black" HorizontalOptions="CenterAndExpand" Text="Stores" />
<Label TextColor="Black" HorizontalOptions="CenterAndExpand" Text="You don't have to worry about your money being stolen from online attacks." ></Label>
<Label TextColor="Black" HorizontalOptions="CenterAndExpand" Text="You now have the option to save your money offline, by your using a device."></Label>
<Label TextColor="Black" HorizontalOptions="CenterAndExpand" Text="Register …Run Code Online (Sandbox Code Playgroud) 我正在使用带有Web API的.net core 2.2。我创建了一个类,即如下:
public class NotificationRequestModel
{
[Required]
public string DeviceId { get; set; }
[Required]
public string FirebaseToken { get; set; }
[Required]
public string OS { get; set; }
public int StoreId { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
使用上面的类,我创建了一个方法。现在,我想返回自定义对象,但返回的是它自己的对象。API方法是:
public ActionResult<bool> UpdateFirebaseToken(NotificationRequestModel model)
{
if (!ModelState.IsValid)
{
return BadRequest(FormatOutput(ModelState.Values));
}
var result = _notificationService.InsertOrUpdateFirebaseToken(model);
return Ok(result);
}
Run Code Online (Sandbox Code Playgroud)
这里的FormatOutput方法是格式化输出。
protected Base FormatOutput(object input, int code = 0, string message = "", string[] details = null)
{
Base …Run Code Online (Sandbox Code Playgroud) 我的代码在下面,我想在折叠和展开完成后上下更改图标。但不知何故它不起作用。
<div class="attach-link">
<a href="javascript:void(0);" *ngIf="fileData.fileDataType.canAttach && !isFinancialEntity" (click)="openFileInput(i)">
<i class="fa fa-plus"></i> Add Attachment</a>
<input type="file" class="hide" id="fileData_{{i}}" ng2FileSelect [uploader]="fileData.uploader" (onFileSelected)="onFileSelected()"
/>
<a class="attachFileList" href="#attachFileList_{{i}}" data-toggle="collapse">
<i class="fa fa-angle-up" ></i>
Attachments [{{fileData.fileList.length}}] </a>
</div>
Run Code Online (Sandbox Code Playgroud)
并添加了脚本:
$('a[data-toggle="collapse"]').click(function () {
//$(this).find('i').addClass('fa fa-angle-up').removeClass('fa fa-angle-down');
$(this).find('i .fa fa-angle-up').toggleClass('fa fa-angle-down');
});
Run Code Online (Sandbox Code Playgroud)
我不知道是什么问题。任何帮助将不胜感激。非常感谢。
我正在使用C#语言来比较两个版本。如何比较两个版本?我使用了下面的代码,但我很困惑它是如何工作的。当我尝试下面的代码时:
var tem = "3.10.1".CompareTo("3.9.0"); // returns -1
var tem1 = "4.0.1".CompareTo("3.9.0"); // returns 1
Run Code Online (Sandbox Code Playgroud)
我还需要 tem 变量的 1 个结果。有人可以指导我吗?
c# ×5
angular ×1
asp.net-core ×1
deviceid ×1
frame ×1
google-api ×1
grid ×1
listview ×1
model ×1
typescript ×1
version ×1
xamarin ×1
xamarin.ios ×1