In my xamarin.forms App I am using material entry provided by xamarin.The control works fine. But how can I change the fontsize of placeholder?In ios the font size of placeholder is perfect, but in android it is much larger. And also the underline of the entry is little more in the left side.How to reduce the gap and align placeholder and underline equally(Refer Image)
What I Have done
What I am trying to achieve
My entry
<Entry x:Name="CustomerEntry" Visual="Material" FontSize="Small" …Run Code Online (Sandbox Code Playgroud) 我已将 Windows 笔记本电脑连接到 2011 年末的 Macbook pro 以开发 xamarin.forms ios 应用程序。我在 Widows 机器上的 Visual Studio 版本是16.7.2xamarin.ios 版本13.20.2.2。我在 Macbook 上的 xamarin.ios 版本是13.14.1.39Xcode 版本是 11.3.1(11C504). 我面临的问题是我无法在 windows 和 mac 上运行 ios 模拟器。我可以在 Mac 上手动打开模拟器。但是当我们针对模拟器运行应用程序时,它会成功构建,但没有出现模拟器。Visual Studio 和 Xcode 上的模拟器下拉菜单显示了大量带有 ios 13.3 的模拟器。应该是什么问题?我已经检查和取消检查"Remote simulator to windows",没有变化。任何帮助表示赞赏。
在我的 Xamarin.forms 应用程序中,我可以使用 Xamarin.Essential 插件拨打指定的电话号码。我面临的问题是,当我在 Android 中单击呼叫我的应用程序时,它将打开电话拨号器,用户应手动单击呼叫。
在 iOS 中,它会直接拨打电话,无需通过拨号器。我的意图是防止编辑拨号器中的号码。
那么,如何在不进入拨号程序的情况下拨打该号码,而是直接在 android 中显示呼叫屏幕?我看过很多帖子,但我没有任何想法。任何帮助表示赞赏。
我正在使用这样的 xamarin.Essential 插件拨打电话
PhoneDialer.Open(PhoneNumber.Text);
Run Code Online (Sandbox Code Playgroud) 在我的 xamarin.forms 应用程序中,我有一个列表视图,其中带有用于选择单个单元格的复选框。我想做的是通过在列表视图外部提供“全选”复选框来多重选择列表视图内的复选框。多重选择工作正常。对于“全选”复选框单击和单个复选框单击,我正在执行一些操作,例如 API 调用。我面临的问题是每当我单击“全选”复选框时,单个复选框的复选框更改事件就会被触发。我知道它很自然,但是有什么方法可以阻止它,例如订阅或取消订阅单个复选框的更改事件或某物?
沙姆尔
<Grid >
<Grid.RowDefinitions>
<RowDefinitions Height="Auto"/>
<RowDefinitions Height="Auto"/>
</Grid.RowDefinitions>
<StackLayout Grid.Row="0" Orientation="Horizontal">
<Label Text="Select All" FontSize="Micro" TextColor="LawnGreen" HorizontalOptions="Start" VerticalOptions="Center" >
</Label>
<CheckBox x:Name="MultiselectCheckbox" ScaleX="0.8" ScaleY="0.8" CheckedChanged="MultiSelectCheckBox_CheckedChanged" IsChecked="False" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Color="LawnGreen"></CheckBox>
</StackLayout>
<ListView
x:Name="Listview"
HorizontalOptions="FillAndExpand"
ItemTapped="DistrictList_ItemTapped"
VerticalOptions="FillAndExpand" >
<ListView.ItemTemplate >
<DataTemplate >
<ViewCell >
<ViewCell.View>
<Frame HorizontalOptions="FillAndExpand">
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand">
<Label Text="{Binding name}" FontSize="Micro" HorizontalOptions="StartAndExpand" VerticalOptions="Center" TextColor="Snow" Margin="5,0,0,0">
</Label>
<CheckBox CheckedChanged="Single_CheckedChanged" IsChecked="{Binding Selected}" Color="LightBlue" HorizontalOptions="End" >
</CheckBox>
</StackLayout>
</Frame>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
Run Code Online (Sandbox Code Playgroud)
多选复选框选中事件 …
我有一个可以接收FCM通知的应用程序。该应用程序在Android Oreo设备以下的操作系统上已收到通知。但是通知未在android oreo设备中接收。它没有发出通知,而是发出了敬酒消息:“开发人员警告程序包无法在通道null上发布通知”。我搜索并了解到通知通道是必需的,但是我不知道要在哪里添加通知通道。请给我指导。吐司正出现在8.0仿真器上。
android android-notifications firebase-cloud-messaging android-8.0-oreo notification-channel
在我的android应用程序中,我有一个名为A的活动。从A处,我调用了一个后台服务。在该服务中,onStartCommand我将执行一些操作AsyncTask并提供了一个转移到另一个名为B的活动的意图。
1.调用Intent后如何停止服务本身?
编辑:我试图打电话,StopSelf();但没有结束我的服务。
2.到达B后,后退按钮将不起作用。目前,如果按后退按钮,我仍然可以转到活动A。
我的意图
Intent dialogIntent = new Intent(UserLoginValidationService.this,SplashScreen.class);
dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
dialogIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
stopSelf();
startActivity(dialogIntent);
Run Code Online (Sandbox Code Playgroud)
编辑:如何调用finishAffinity();服务?
任何帮助表示赞赏。
这个问题已在 SO 和 xamarin.forums 上多次被问到。但我无法解决这个问题。
在我的 xamarin.forms android 应用程序中,我有一个启动画面。它完美启动。问题是在加载我的主页和启动画面之间,会出现白屏闪烁。我遵循了https://xamarinhelp.com/creating-splash-screen-xamarin-forms/ 中的教程。
我尝试通过为启动画面创建特定活动并将启动主题直接设置为 MainActivity。两种方式我都无法摆脱白屏闪烁。我在发布模式下尝试过,问题仍然存在。这是使用 xamarin 的预期行为吗?我怎样才能删除它?任何帮助表示赞赏。
我的主要活动
[Activity(Label = "SampleApp", Icon = "@mipmap/ic_launcher", Theme = "@style/splashscreen", ScreenOrientation = ScreenOrientation.Portrait, MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
static readonly string TAG = "MainActivity";
protected override void OnCreate(Bundle savedInstanceState)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
global::Xamarin.Forms.Forms.SetFlags("CollectionView_Experimental");
base.SetTheme(Resource.Style.MainTheme);
base.OnCreate(savedInstanceState);
}
}
Run Code Online (Sandbox Code Playgroud)
我Init()在 MainActivity 中有几个库,这里不包括在内。
我的 App.Xaml.cs
public partial class App …Run Code Online (Sandbox Code Playgroud)