xamarin.forms

How to create and implement a Android CustomOverlay for ZXing Scanner?

有些话、适合烂在心里 提交于 2021-01-29 08:53:29
问题 I'm using ZXing barcode scanner plugin for my Xamarin.Forms project. According to some posts, I need to use custom overlay for ZXing scanner in order to have cancel button. But I'm not familiar with Android development in a Xamarin.Forms project. So far, I know a scanner (MobileBarcodeScanner of ZXing plugin) accept an Android.Views.View as an overlay to replace the default scanning page view. public async Task<string> ScanAsync() { MobileBarcodeScanner scanner = new MobileBarcodeScanner();

How to binding property in a behavior?

人盡茶涼 提交于 2021-01-29 08:46:55
问题 I created a behavior to use a phone mask. It is working properly, when the Mask is inserted explicitly. But I would like to communicate with the view model to change the mask, when I change the type of phone in the picker. In xaml file: <Picker x:Name="picker_cadastronotificacao_tipotelefone" Title="{x:Static local:AppResources.picker_cadastronotificacao_tipotelefone}" Style="{StaticResource Picker}" SelectedItem="{Binding TipoTelefoneSelecionado}"> <Picker.Items> <x:String>Celular</x:String>

Problems with Bindings in Xamarin Forms (MVVM)

喜夏-厌秋 提交于 2021-01-29 08:45:12
问题 I am having some problems understanding xaml with mvvm. Sometimes works but others doesn't. ViewModel (implements INotifyPropertyChanged): private Class1 firstClass; public Class1 FirstClass{ get{return firstClass;} set{firstClass = value; OnPropertyChanged();} } private string name; public string Name{ get{return name;} set{name = value; OnPropertyChanged();} } private string address; public string Address{ get{return address;} set{address = value; OnPropertyChanged();} } View: private

How to nest Tab views in Xamarin.Forms

空扰寡人 提交于 2021-01-29 08:43:45
问题 I am trying to create this layout in Xamarin XAML but I cannot figure out how to combine TabView within a TabView. I want 3 main tabs in the bottom and for each page 1-2 subtabs. On each subtab I will need to have a ScrollView(I think thats the right element to use) with list items, which makes it even more complex. Like this picture: Any idea or guidance of how to achieve this? 回答1: I am trying to create this layout in Xamarin XAML but I cannot figure out how to combine TabView within a

Local notification not triggering in Android 10

拈花ヽ惹草 提交于 2021-01-29 08:31:33
问题 I am working on xamarin.forms app and I am setting local notification using alarm manager. It is triggering fine on android version 8 and 9 but somehow it's not triggering in Android 10 . In android device logs for Android 10 , I got 07-22 15:00:06.612 Samsung SM-M205F Verbose 4185 SamsungAlarmManager Sending to uid : 10244 action=null alarm=Alarm{a757a70 type 0 when 1595410200000 com.MyApp.andr.connect} 07-22 15:00:06.613 Samsung SM-M205F Warning 4185 BroadcastQueue Unable to launch app com

Xamarin Forms: How to check if GPS is on or off in Xamarin ios app?

不问归期 提交于 2021-01-29 08:12:05
问题 Whenever I am opening my app I need to check the GPS is on or off. If the GPS is off, I need to redirect the user to the location settings page. I have done the android part using the dependency service like below. ILocSettings public interface ILocSettings { void OpenSettings(); bool isGpsAvailable(); } Android implementation [assembly: Dependency(typeof(LocationShare))] namespace Projectname.Droid.Services { public class LocationShare : ILocSettings { public bool isGpsAvailable() { bool

Http Get Request not getting any data

谁说我不能喝 提交于 2021-01-29 08:00:37
问题 I have my Web Api on a production server online and working well in postman and in Xamarin forms so far until I needed to do a Get Request and does not return any data. Infact it stops at the GetAsStringAsync line and does not continue. Instead, it jumps out of the method and then nothing more. Does any one know what the problem could be? I have checked and made sure my Internet is working and the Uri too. This is where I am doing my Get in Xamarin forms: public async Task<List<OfferModel>>

How could I change the Navigastion's page arrow in Xamarin Forms?

故事扮演 提交于 2021-01-29 07:32:47
问题 I'm creating an app using xamarin Forms (multiplatform), I'm using a Navigation page, but I want to change the arrow ("<-") to text ("back") Do you know how could i do it? Thanks (I'm going to use it in an Android App, but I'm creating the app using Xamarin forms) 回答1: You could use custom renderer to remove the navigation icon and set it with text. But, when you do that, you need to capture the click of the text and simulate the back event. Create the interface: public class

EXC_BAD_ACCESS In Test Flight

偶尔善良 提交于 2021-01-29 07:20:27
问题 My Xamarin application runs flawlessly when ran on a simulator, or on Android. The problem is arisen when I deploy it to TestFlight and attempt to run it on iOS. It's giving a very odd behavior which I've been trying to wrap my head around for some time. About 70% of the time, the app crashes immediately on launch. Once the app crashes, you can re-launch the app and it will have no issue. Then if you restart the device, or wait hours (I'm assuming because whatever iOS's garbage collection is

How to change font family of label in Xamarin.Forms

被刻印的时光 ゝ 提交于 2021-01-29 07:12:44
问题 I tried to change font-family of my label using CSS and XAML but the font is not reflecting. I am trying to use Montserrat font in my app. How can I fix this? XAML Code: <Label StyleClass="label" Text="Sample"/> CSS code: .label{ font-family: Montserrat; } 回答1: In order to use custom fonts in your project, you have to do the following: In your Android Project, place your font file in your Assets folder, and ensure the build type is AndroidAsset. Then you can, in your XAML, declare the font in