Hello,
I'm doing a menu using master detail page. And I need to add submenus only in one of the options.
I have looked at grouping in listviews, but that would work if every option have sub menus.
What would be the best way to do this?
Thanks
Hello,
I'm doing a menu using master detail page. And I need to add submenus only in one of the options.
I have looked at grouping in listviews, but that would work if every option have sub menus.
What would be the best way to do this?
Thanks
Hi all,
I've this problem: I am developing a PCL app and I need to call Api hosted in my working company's server. This endpoint have a self signed certificate encrypted and authenticated using TLS 1.2 ECDHE_RSA with X25519 , and AES_256_GCM.
In OnCreate(Droid) and in FinishedLaunching(iOS) methods I have added this code (suggested by tons of similar post):
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;
to resolve the problem of the untrusted certificate.
In Android works well but in iOS my request incurs in timeout response.
One solution is send the certificate to all devices in test environment and install it on device, but I am not able to send the certificate.
Then, how can i resolve this?
Thank you in advance for anyone who wants to answer.
I have a new Windows 10 machine. I have pulled my source code that is working great on my old Windows machine but continually get the above error on the new machine I have reinstalled Visual Studio, I have repaired Visual Studio, I have downloaded and pointed to the NDK, I have downloaded and installed the JDK (first 9.0 and then 8.0) I have removed and restored NuGet packages and I have prayed to the gods of programming.
Any suggestions?
Thanks
Hi!
I have finished my app, but I have tested it with the iPhone X simulator and I'm totally out of the safe margins.
I'm searching for info everywhere, but I can't find anything specific to that.
I have alleviated the problem using always a NavigationBar, but the problem still persists if I put the device in landscape mode.
Does someone know how to apply extra margins if necessary with the iPhone X?
Thanks!
Hi
I'm having troubles with my Xamarin.Forms android app.
Generally speaking, the app works fine. However, there's a special case when it doesn't, which then breaks the app completely. When I put the app in the background, and leave it there for long enough, when resumed the UI is not getting "loaded" - the app gets stuck on an 'init' screen (not even a splash screen) with just colored background showing. Unfortunately I can't replicate this situation when debugging, so I'm reaching out to the community for an advice.
Details:
After getting the app into this state, when loading the app from the background after a long time, the app behaves as explained above. Afterwards, any fresh launch of the app ends with the same result. When I connect with adb logcat to my device, it seems that the app got itself into some sort of infinte loop of trying to load this library libmonosgen-2.0
. Because it cannot find it, it kills the app process and retries...
Here is the output from logcat:
3593 I ActivityManager: Start proc 8127:com.<app_name>/u0a608 for activity com.<app_name>/md584b42f4d6694c2e36108d8eacdde5765.SplashScreen 03-15 20:24:35.387 8127 8127 I zygote64: Late-enabling -Xcheck:jni 03-15 20:24:35.530 8127 8127 I MultiDex: VM with version 2.1.0 has multidex support 03-15 20:24:35.530 8127 8127 I MultiDex: install 03-15 20:24:35.530 8127 8127 I MultiDex: VM has multidex support, MultiDex support library is disabled. 03-15 20:24:35.565 8127 8127 W monodroid: Creating public update directory:
/data/user/0/com./files/.__override__ 03-15 20:24:35.565 8127 8127 W monodroid: Using override path: /data/user/0/com.<app_name>/files/.__override__ 03-15 20:24:35.565 8127 8127 W monodroid: Using override path: /storage/emulated/0/Android/data/com.<app_name>/files/.__override__ 03-15 20:24:35.566 8127 8127 W monodroid: Trying to load sgen from: /data/user/0/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.566 8127 8127 W monodroid: Trying to load sgen from: /storage/emulated/0/Android/data/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.566 8127 8127 W monodroid: Trying to load sgen from: /storage/emulated/0/../legacy/Android/data/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.566 8127 8127 W monodroid: Trying to load sgen from: /data/app/com.<app_name>-FxDDioqwXRGIUHcRRW4_0w==/lib/arm64/libmonosgen-2.0.so 03-15 20:24:35.566 8127 8127 W monodroid: Trying to load sgen from: /data/user/0/com.<app_name>/files/.__override__/links/libmonosgen-2.0.so 03-15 20:24:35.566 8127 8127 W monodroid: Trying to load sgen from: /system/lib/libmonosgen-2.0.so 03-15 20:24:35.566 8127 8127 F monodroid: cannot find libmonosgen-2.0.so in override_dir: /data/user/0/com.<app_name>/files/.__override__, app_libdir: /data/app/com.<app_name>-FxDDioqwXRGIUHcRRW4_0w==/lib/arm64 nor in previously printed locations. 03-15 20:24:35.566 8127 8127 F monodroid: Do you have a shared runtime build of your app with AndroidManifest.xml android:minSdkVersion < 10 while running on a 64-bit Android 5.0 target? This combination is not supported. 03-15 20:24:35.566 8127 8127 F monodroid: Please either set android:minSdkVersion >= 10 or use a build without the shared runtime (like default Release configuration). 03-15 20:24:35.596 3583 6571 I ActivityManager: Process com.<app_name> (pid 8127) has died: fore TOP 03-15 20:24:35.597 3583 3601 W zygote64: kill(-8127, 9) failed: No such process 03-15 20:24:35.597 3132 3132 I Zygote : Process 8127 exited cleanly (15) 03-15 20:24:35.611 3583 6571 I ActivityManager: Start proc 8142:com.<app_name>/u0a608 for activity com.<app_name>/md584b42f4d6694c2e36108d8eacdde5765.SplashScreen 03-15 20:24:35.612 8142 8142 I zygote64: Late-enabling -Xcheck:jni 03-15 20:24:35.633 3583 3601 W zygote64: kill(-8127, 9) failed: No such process 03-15 20:24:35.633 3583 3601 I zygote64: Successfully killed process cgroup uid 10608 pid 8127 in 36ms 03-15 20:24:35.742 8142 8142 I MultiDex: VM with version 2.1.0 has multidex support 03-15 20:24:35.742 8142 8142 I MultiDex: install 03-15 20:24:35.742 8142 8142 I MultiDex: VM has multidex support, MultiDex support library is disabled. 03-15 20:24:35.786 8142 8142 W monodroid: Creating public update directory:
/data/user/0/com./files/.__override__ 03-15 20:24:35.786 8142 8142 W monodroid: Using override path: /data/user/0/com.<app_name>/files/.__override__ 03-15 20:24:35.786 8142 8142 W monodroid: Using override path: /storage/emulated/0/Android/data/com.<app_name>/files/.__override__ 03-15 20:24:35.786 8142 8142 W monodroid: Trying to load sgen from: /data/user/0/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.787 8142 8142 W monodroid: Trying to load sgen from: /storage/emulated/0/Android/data/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.787 8142 8142 W monodroid: Trying to load sgen from: /storage/emulated/0/../legacy/Android/data/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.787 8142 8142 W monodroid: Trying to load sgen from: /data/app/com.<app_name>-FxDDioqwXRGIUHcRRW4_0w==/lib/arm64/libmonosgen-2.0.so 03-15 20:24:35.787 8142 8142 W monodroid: Trying to load sgen from: /data/user/0/com.<app_name>/files/.__override__/links/libmonosgen-2.0.so 03-15 20:24:35.787 8142 8142 W monodroid: Trying to load sgen from: /system/lib/libmonosgen-2.0.so 03-15 20:24:35.787 8142 8142 F monodroid: cannot find libmonosgen-2.0.so in override_dir: /data/user/0/com.<app_name>/files/.__override__, app_libdir: /data/app/com.<app_name>-FxDDioqwXRGIUHcRRW4_0w==/lib/arm64 nor in previously printed locations. 03-15 20:24:35.787 8142 8142 F monodroid: Do you have a shared runtime build of your app with AndroidManifest.xml android:minSdkVersion < 10 while running on a 64-bit Android 5.0 target? This combination is not supported. 03-15 20:24:35.787 8142 8142 F monodroid: Please either set android:minSdkVersion >= 10 or use a build without the shared runtime (like default Release configuration). 03-15 20:24:35.817 3583 21143 I ActivityManager: Process com.<app_name> (pid 8142) has died: fore TOP 03-15 20:24:35.817 3583 3601 W zygote64: kill(-8142, 9) failed: No such process 03-15 20:24:35.818 3132 3132 I Zygote : Process 8142 exited cleanly (15) 03-15 20:24:35.833 3583 21143 I ActivityManager: Start proc 8157:com.<app_name>/u0a608 for activity com.<app_name>/md584b42f4d6694c2e36108d8eacdde5765.SplashScreen 03-15 20:24:35.837 8157 8157 I zygote64: Late-enabling -Xcheck:jni 03-15 20:24:35.862 3583 3601 W zygote64: kill(-8142, 9) failed: No such process 03-15 20:24:35.862 3583 3601 I zygote64: Successfully killed process cgroup uid 10608 pid 8142 in 44ms 03-15 20:24:35.956 8157 8157 I MultiDex: VM with version 2.1.0 has multidex support 03-15 20:24:35.956 8157 8157 I MultiDex: install 03-15 20:24:35.956 8157 8157 I MultiDex: VM has multidex support, MultiDex support library is disabled. 03-15 20:24:35.993 8157 8157 W monodroid: Creating public update directory:
/data/user/0/com./files/.__override__ 03-15 20:24:35.993 8157 8157 W monodroid: Using override path: /data/user/0/com.<app_name>/files/.__override__ 03-15 20:24:35.993 8157 8157 W monodroid: Using override path: /storage/emulated/0/Android/data/com.<app_name>/files/.__override__ 03-15 20:24:35.994 8157 8157 W monodroid: Trying to load sgen from: /data/user/0/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.994 8157 8157 W monodroid: Trying to load sgen from: /storage/emulated/0/Android/data/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.994 8157 8157 W monodroid: Trying to load sgen from: /storage/emulated/0/../legacy/Android/data/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.994 8157 8157 W monodroid: Trying to load sgen from: /data/app/com.<app_name>-FxDDioqwXRGIUHcRRW4_0w==/lib/arm64/libmonosgen-2.0.so 03-15 20:24:35.994 8157 8157 W monodroid: Trying to load sgen from: /data/user/0/com.<app_name>/files/.__override__/links/libmonosgen-2.0.so 03-15 20:24:35.994 8157 8157 W monodroid: Trying to load sgen from: /system/lib/libmonosgen-2.0.so 03-15 20:24:35.994 8157 8157 F monodroid: cannot find libmonosgen-2.0.so in override_dir: /data/user/0/com.<app_name>/files/.__override__, app_libdir: /data/app/com.<app_name>-FxDDioqwXRGIUHcRRW4_0w==/lib/arm64 nor in previously printed locations. 03-15 20:24:35.994 8157 8157 F monodroid: Do you have a shared runtime build of your app with AndroidManifest.xml android:minSdkVersion < 10 while running on a 64-bit Android 5.0 target? This combination is not supported. 03-15 20:24:35.994 8157 8157 F monodroid: Please either set android:minSdkVersion >= 10 or use a build without the shared runtime (like default Release configuration). 03-15 20:24:36.033 3583 6573 I ActivityManager: Process com.<app_name> (pid 8157) has died: fore TOP 03-15 20:24:36.033 3583 3601 W zygote64: kill(-8157, 9) failed: No such process 03-15 20:24:36.035 3132 3132 I Zygote : Process 8157 exited cleanly (15)
Info about the app:
Xamarin.Forms v2.5.0.280555
Xamarin.Maps v2.5.0.280555
Min Android v19 - KitKat
Target Android v26 - Oreo
The app is being tested on Nexus 5X with Android v8.1.0
I should also mention that I use MvvmCross 5.6.3 and the first page is a Master Details with the map showing by default in the Details.
Is this a Xamarin.Forms bug? Should I report this? Maybe I'm not doing something I should be? Specifically in OnResume method?
Any advice will be much appreciated
Cheers
Android ontouch lets the finger to drag from the view and track every finger movement x,y coordinate.
This involves that finger DOWN motion need to be invoked first on the view in order to invoke dragging motion.
However can I somehow invoke drag over event on other element not essentially started finger down from that view?
eg,
View 1, View 2
Finger down on View 1
Drag my finger over on top of View 2 and Invoke View 2 hover ? event?
Can this be achieved?
Dont want to use drag or dragshadowbuilder
I am using secondary toolbar items in my content page. I want the same menu items in iOS as in android. By default it is showing under navigation bar. How can I achieve this.
Hi,
I am using:
NavigationPage.SetBackButtonTitle(this, "Home");
from my HomePage ContentPage XAML to set the main Back text
with my app I have a SettingsContentView which is shown on the HomePage itself
when the user clicks any button on the SettingsContentView it will open another ContentPage e..g ChangePasswordContentPage
From ChangePasswordContentPage how can I make
NavigationPage.SetBackButtonTitle(this, "Back");
instead of:
NavigationPage.SetBackButtonTitle(this, "Home");
because it's actually going back to the SettingContentView and although it's a view of the HomePage ContentPage but it's confusing
so is there any way to do this please?
Thanks,
Jassim
I think that we dont need to unsubscribe an event if defined in xaml. if we subscribe named event like that in OnAppearing method of the page
_listView.SelectionChanged += listviewchangedevent;
we need to unsubscribe on OnDissapearing method
_listView.SelectionChanged -= listviewchangedevent;
But what about below usage?
_listView.SelectionChanged += (sender, args) =>
{
// Do something
};
Can this cause a memory cycle?
I am planning to use ZXing.Net(.Mobile) in a Xamarin.Forms app.
Scanning barcode black on white works no problem, using the various Barcode scanner samples (e.g. Acr.Barcodes, thanks)
Client has thousands of barcodes in black on yellow background.
These do not scan.
How to configure ZXing.Net to filter out the yellow background?
I have taken several photos of the barcode black on yellow and with a couple of manual contrast and brightness adjustments, I can easily remove the yellow background and improve the barcode.
Can this be done dynamically in ZXing.Net, and if so, can a workable code snippet be provided?
A snippet from the iOS or Android world would be helpful...
Very new to ZXing, so not sure if this can be done or where to start with adjustment.
Thanks, Geoff
Hi, i am new in xamarin forms and i want to implement image encryption and decryption. I have java code that do the encryption and decryption for the image and i want to convert it to C# that work in xamarin forms and this is my java code can any one covert it to me please.
package imageencryptanddecrypt;
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.security.SecureRandom;
import javax.imageio.ImageIO;
public class ImageEncryptAndDecrypt {
public static void main(String s[]){
String sPath="picture.jpg";
String dPath="picture.jpg";
String password="1234";
StringBuilder sb=new StringBuilder();
char st;
int value;
try{
for (int i = 0; i < password.length(); i++) {
st=password.charAt(i);
value=(int)st;
sb.append(value);
}
SecureRandom sr= SecureRandom.getInstance("SHA1PRNG");
sr.setSeed(sb.toString().getBytes());
BufferedImage FSImg=ImageIO.read(new File(sPath));
for (int w = 0; w < FSImg.getWidth(); w++) {
for (int h = 0; h < FSImg.getHeight(); h++) {
Color color=new Color(FSImg.getRGB(w, h));
Color newColor=new Color(color.getRed()^sr.nextInt(255), color.getGreen()^sr.nextInt(255), color.getBlue()^sr.nextInt(255));
FSImg.setRGB(w, h, newColor.getRGB());
}
}
System.out.println("Process Completed!!..");
ImageIO.write(FSImg, "bmp", new File(dPath));
System.out.println("Wrote to "+dPath);
}catch(Exception e){
e.printStackTrace();}
}
}
I am developing a cross platform mobile app with Xamarin Forms PCL. There I want to create a screen with Google Map, for that have added NuGet package i.e. Xamarin.Forms.Maps as guided in https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/. But after installing this package, my solution stopped working and event I can't clean/rebuild it. Below is detailed error log:
Project 'WorkingWithMaps.Android' requires the following components installed on your machine:
Xamarin.GooglePlayServices.Base
JavaLibraryReference: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-base/8.4.0/play-services-base-8.4.0.aar-8.4.0
AndroidResources: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-base/8.4.0/play-services-base-8.4.0.aar-8.4.0
Xamarin.GooglePlayServices.Maps
JavaLibraryReference: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-maps/8.4.0/play-services-maps-8.4.0.aar-8.4.0
AndroidResources: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-maps/8.4.0/play-services-maps-8.4.0.aar-8.4.0Please double-click here to install it.
Intallation Errors: XA5209 Unzipping failed. Please download 'https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip:m2repository/com/google/android/gms/play-services-base/8.4.0/play-services-base-8.4.0.aar' and extract it to the 'C:\Users\XYZ\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Base\8.4.0\embedded' directory
XA5209 Reason: The process cannot access the file 'C:\Users\XYZ\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Base\8.4.0\embedded\res\drawable-xxhdpi' because it is being used by another process.
XA5207 Please install package: 'GPS Base' available in SDK installer. Java library file 'C:\Users\XYZ\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Base\8.4.0\content\classes.jar' doesn't exist.
XA5207 Please install package: 'GPS Maps' available in SDK installer. Java library file 'C:\Users\XYZ\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Maps\8.4.0\content\classes.jar' doesn't exist.
Any suggestion would be great help for me.
Hello,
I use this renderer in my Droid project for get flat button but after an OS reinstall and an update packages VS it's doesn't work whereas before this renderer has working, any ideas?
using Xamarin.Forms.Platform.Android;
using Xamarin.Forms;
using Android.Content;
[assembly: ExportRenderer(typeof(Button), typeof(MyProject.Droid.Renderers.FlatButtonRenderer))]
namespace MyProject.Droid.Renderers
{
public class FlatButtonRenderer : ButtonRenderer
{
// Constructors
public FlatButtonRenderer(Context context) : base(context) { }
// Methods
protected override void OnDraw(Android.Graphics.Canvas canvas)
{
base.OnDraw(canvas);
}
}
}
Best regards
Please find my below code:
private void OnNewUserButtonClick(object sender, EventArgs eventArgs)
{
for (var count = 1; count <= 3; count++)
{
Navigation.RemovePage(this.Navigation.NavigationStack[6 - count]);
}
Navigation.PopAsync();
}
=========================================
MY QUESTION:
On clicking the particular button, I want to remove the previous 3 pages and need to PopAsync; so that I will be navigating back to the page I want (ex., navigating from 6th page to 2nd page).
All works fine as expected but, on navigating, the page (ex., 2nd page) appears AFTER SHOWING BLANK SCREEN for a fraction of millisecond (0.5 Sec).
I have checked OnAppearing method in second page and I done nothing there for hiding the UI.
Is that a Xamarin Forms issue...?
Your response are well appreciated..
Thank you in advance.
i have this error:
Attempting to resolve dependencies for multiple packages. One or more unresolved package dependency constraints detected in the existing packages.config file. All dependency constraints must be resolved to add or update packages. If these packages are being updated this message may be ignored, if not the following error(s) may be blocking the current package operation: 'Xamarin.Forms 2.5.0.121934 constraint: Xamarin.Android.Support.v7.AppCompat (= 23.3.0)', 'Xamarin.Forms 2.5.0.121934 constraint: Xamarin.Android.Support.v7.CardView (= 23.3.0)', 'Xamarin.Forms 2.5.0.121934 constraint: Xamarin.Android.Support.Design (= 23.3.0)', 'Xamarin.Forms 2.5.0.121934 constraint: Xamarin.Android.Support.v4 (= 23.3.0)', 'Xamarin.Forms 2.5.0.121934 constraint: Xamarin.Android.Support.v7.MediaRouter (= 23.3.0)' Unable to find a version of 'Xamarin.Android.Support.Design' that is compatible with 'Xamarin.Forms 2.5.0.274780 constraint: Xamarin.Android.Support.Design (= 23.3.0)'.
while am trying to update NuGet packages. i tried to find a solution but no solution is working with me.
am using visual studio community for mac.
So please help because am new to Xamarine.
i am creating a new chat Messenger but i am not understand how to use Socket.IO Client .NET in my app plz Help
Hello,
I am developing app using Xamarin.Forms. I have a requirement where in user can select any image from gallery and should be able to set as background image on all the pages.
I understand there is a backgroundImage property in Page control to which background can be set however its value can only be assigned to inbuilt resources images (i.e. images which are part of project as resource) and I can't assign the gallery image here. If I'm not correct then pls point me the way how to use non resources image.
Also, I want the set background Image to all the pages once setting is done. How I can apply the image to all the pages simultaneously?
Any pointer/help will be much appreciated.
Regards,
Hello,
i encounter troubles for styling my custom control.
I've created a customButton class which is inherited from Button. This class contains some bindable properties like this
public static readonly BindableProperty TextColorPressedProperty = BindableProperty.Create("TextColorPressed", typeof(Color?), typeof(CustomButton), null);
public Color? TextColorPressed
{
set { SetValue(TextColorPressedProperty, value); }
get { return (Color?)GetValue(TextColorPressedProperty); }
}
However, when i try to declare a custom style in my xaml...
<ContentPage.Resources>
<ResourceDictionary>
<Style x:Key="CustomButtonBaseStyle" TargetType="cc:CustomButton">
<Setter Property="BackgroundColor" Value="Red"/>
<Setter Property="TextColor" Value="Blue"/>
<Setter Property="TextColorPressed" Value="Blue"/>
</Style>
</ResourceDictionary>
</ContentPage.Resources>
I just get a crash
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidProgramException: Invalid IL code in XPlatformApp.Views.ButtonsPage:InitializeComponent (): IL_0234: newobj 0x0a000083
If i comment "TextColorPressed" property in my custom style, everything is ok.
Any idea about the right way to integrate custom bindable property into a style template ?
Is it possible to have a spacing between TableSections within a TableView on Android just like iOS did it?
As already in the title I want to get rid of the refresh spinner symbol when refreshing a listview.
Is there any way to do this?
I know the magic keyword is custom renderer but how can I access the spinner from here?