xamarin.forms

Is it possible to access external storage in platform-independent code in Xamarin.Forms?

风流意气都作罢 提交于 2021-02-08 03:33:05
问题 I'm mainly developing for Android, so I know one can access the external storage of an Android device in Xamarin.Forms using Android.Content.Context.GetExternalFilesDir . I know its possible to access the internal storage platform-independently using Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) , but is it also possible to do the same for external storage? I know the use case might be prettty limited, as iOS doesn't allow any non-jailbreaked access to the file

Customize named font sizes depending on the screen-size

大城市里の小女人 提交于 2021-02-08 03:08:30
问题 In a xamarin.forms app, how could I customize named font sizes depending on the screen-size for the default ones don't work for me? mainScale.LabelFontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) * 2.5; I've hardcoded 2.5 because it looks better. Could you please let me know how I could have these hardcoded ones changed to a dynamic factor in a cross-platform app? 回答1: This is a Idea to how to create sizes. App.xaml.cs public static double DisplayScreenWidth = 0f; public static

Customize named font sizes depending on the screen-size

巧了我就是萌 提交于 2021-02-08 03:07:58
问题 In a xamarin.forms app, how could I customize named font sizes depending on the screen-size for the default ones don't work for me? mainScale.LabelFontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) * 2.5; I've hardcoded 2.5 because it looks better. Could you please let me know how I could have these hardcoded ones changed to a dynamic factor in a cross-platform app? 回答1: This is a Idea to how to create sizes. App.xaml.cs public static double DisplayScreenWidth = 0f; public static

Customize named font sizes depending on the screen-size

主宰稳场 提交于 2021-02-08 03:07:29
问题 In a xamarin.forms app, how could I customize named font sizes depending on the screen-size for the default ones don't work for me? mainScale.LabelFontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) * 2.5; I've hardcoded 2.5 because it looks better. Could you please let me know how I could have these hardcoded ones changed to a dynamic factor in a cross-platform app? 回答1: This is a Idea to how to create sizes. App.xaml.cs public static double DisplayScreenWidth = 0f; public static

Go to page and clear the stack [Xamarin Forms]

元气小坏坏 提交于 2021-02-08 02:10:55
问题 I have navigation stack like this: Page1 -> Page2 -> Page3 -> Page4 -> Page5 -> Page6 And I want to Navigate TO Page2 FROM Page6 and clear rest of pages (Page3, Page4, Page5) How can I do this? Thanks in advance! 回答1: When you want to navigate back a count of pages, you need to remove count pages from the navigation stack: for (var i = 1; i < countPagesToRemove; i++) { Navigation.RemovePage(Navigation.NavigationStack[Navigation.NavigationStack.Count - 2]); } await Navigation.PopAsync(); 来源:

Xamarin Forms ListView onpressing event

隐身守侯 提交于 2021-02-08 02:10:49
问题 I want to change the Image by changing the IconToShow propery with binding (programmatically), when the item is pressing. How can I trigger an OnPressed event ?? <ListView x:Name="listView" ItemSelected="OnItemSelected" ItemsSource="{Binding MainMenuList}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" IsVisible="{Binding MenuStyle, Converter={StaticResource not}" SeparatorColor="Blue"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <ViewCell.View> <Grid> <Grid

Xamarin Forms ListView onpressing event

情到浓时终转凉″ 提交于 2021-02-08 02:05:46
问题 I want to change the Image by changing the IconToShow propery with binding (programmatically), when the item is pressing. How can I trigger an OnPressed event ?? <ListView x:Name="listView" ItemSelected="OnItemSelected" ItemsSource="{Binding MainMenuList}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" IsVisible="{Binding MenuStyle, Converter={StaticResource not}" SeparatorColor="Blue"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <ViewCell.View> <Grid> <Grid

Go to page and clear the stack [Xamarin Forms]

和自甴很熟 提交于 2021-02-08 02:05:26
问题 I have navigation stack like this: Page1 -> Page2 -> Page3 -> Page4 -> Page5 -> Page6 And I want to Navigate TO Page2 FROM Page6 and clear rest of pages (Page3, Page4, Page5) How can I do this? Thanks in advance! 回答1: When you want to navigate back a count of pages, you need to remove count pages from the navigation stack: for (var i = 1; i < countPagesToRemove; i++) { Navigation.RemovePage(Navigation.NavigationStack[Navigation.NavigationStack.Count - 2]); } await Navigation.PopAsync(); 来源:

xamarin forms xaml OnPlatform not working on bindings

安稳与你 提交于 2021-02-07 21:54:22
问题 <cv:BindableComboBox ItemsSource="{Binding Themes}" SelectedValue="{Binding SelectedTheme}"> <cv:BindableComboBox.Title> <OnPlatform x:TypeArguments="x:String" iOS="{Binding ThemePickerTitle}" Android="{Binding ThemePickerTitle}"/> </cv:BindableComboBox.Title> </cv:BindableComboBox> so I have picker and I want to bind its Title to ThemePickerTitle property. It works well if I write it as inline attrubute. But I dont want to have title on windows. So I write OnPlatform to have it only on Ios

xamarin forms xaml OnPlatform not working on bindings

时光怂恿深爱的人放手 提交于 2021-02-07 21:52:59
问题 <cv:BindableComboBox ItemsSource="{Binding Themes}" SelectedValue="{Binding SelectedTheme}"> <cv:BindableComboBox.Title> <OnPlatform x:TypeArguments="x:String" iOS="{Binding ThemePickerTitle}" Android="{Binding ThemePickerTitle}"/> </cv:BindableComboBox.Title> </cv:BindableComboBox> so I have picker and I want to bind its Title to ThemePickerTitle property. It works well if I write it as inline attrubute. But I dont want to have title on windows. So I write OnPlatform to have it only on Ios