我正在开发 Xamarin 表单应用程序,我的应用程序似乎在顶部设置了安全区域。但需要忽略它。
当前场景:
例外情况:
我在谷歌上搜索过这个并获得了以下链接,按照以下链接中所述进行了尝试,但没有任何效果。
https://forums.xamarin.com/discussion/104945/iphone-x-and-safe-margins-with-xamarin-forms
https://blog.xamarin.com/making-ios-11-even-easier-xamarin -形式/
但不知道如何在上面链接中提到的以下行中访问Xamarin 表单内容页面下的SetPrefersLargeTitles。
On<Xamarin.Forms.PlatformConfiguration.iOS>().SetPrefersLargeTitles(true);
Run Code Online (Sandbox Code Playgroud)
请帮我解决这个问题。
问候, 切兰
我正在WPF应用程序中实现多个文件下载进度.如果互联网在下载过程中失败,我需要维护下载的数据并恢复下载.
例如,在下载过程中,如果互联网出现故障,我需要等待5分钟才能重新连接互联网并恢复下载,如果5分钟后无法重新连接,则需要终止请求.并且该过程需要是Async,因为我正在下载多个文件,并且第二个文件在下载第一个文件之前不能开始下载.
using (client = new WebClient())
{
try
{
client.DownloadProgressChanged += client_DownloadProgressChanged;
client.DownloadFileCompleted += client_DownloadFileCompleted(fileName);
await AsyncPlatformExtensions.DownloadFileTaskAsync(client, new Uri(sourceUri), outputDir);
}
catch(WebException exe)
{
}
catch(Exception e)
{
}
}
Run Code Online (Sandbox Code Playgroud)
我已经检查了下面的一些链接,但似乎没有一个工作.
https://github.com/Avira/.NetFileDownloader
https://github.com/markodt/SGet
https://www.codeproject.com/Tips/307548/Resume-Suppoert-Downloading
如果互联网在指定时间内重新连接,请分享您对如何保留下载缓存并恢复下载的想法.
问候,
基兰
我需要在 Xamarin Android 和 Xamarin iOS 的应用程序中使用搜索栏。
我必须在我的应用程序中实现以下搜索栏。
请找到xaml中使用的代码,
<Frame Padding="0" OutlineColor="DarkGray" HasShadow="True" HorizontalOptions="FillAndExpand" VerticalOptions="Center">
<SearchBar x:Name="searchBar" Placeholder="Search" PlaceholderColor="LightGray" TextColor="#000000" HorizontalOptions="FillAndExpand" VerticalOptions="Center" TextChanged="SearchBar_TextChanged"/>
</Frame>
Run Code Online (Sandbox Code Playgroud)
我的搜索栏如下所示,需要从 xamarin android 中删除突出显示的行。
还可以找到搜索栏渲染器代码,
protected override void OnElementChanged(ElementChangedEventArgs<SearchBar> e)
{
base.OnElementChanged(e);
var color = global::Xamarin.Forms.Color.LightGray;
var searchView = (Control as SearchView);
var searchIconId = searchView.Resources.GetIdentifier("android:id/search_mag_icon", null, null);
if (searchIconId > 0)
{
var searchPlateIcon = searchView.FindViewById(searchIconId);
(searchPlateIcon as ImageView).SetColorFilter(color.ToAndroid(), PorterDuff.Mode.SrcIn);
}
var symbolView = (Control as SearchView);
var symbolIconId = symbolView.Resources.GetIdentifier("android:id/search_close_btn", null, null);
if(symbolIconId>0)
{ …
Run Code Online (Sandbox Code Playgroud)