Hi there
My Android app works Ok on phone and tablet devices. When I try to launch it in Google Chrome (via ARC Welder add-on), it is no-go. It shows a "sad puzzle" icon on the screen.
What could be wrong with my app?
Thanks.
ARC Welder fails to launch my App
UINavigationBar.Appearance.BackIndicatorImage not working (solved)
Hi, I'm trying to customize the status bar of my app. In the shared code I use NavigationPage.PushAsync calls to navigate to a new page, as result the new page has a status bar with < Back at the top. In my Android app I could customize it and put the Logo of the app instead of "< Back". I wanna have the same in my iOS app.
I did as in this thread.
In my AppDelegate.cs file, FinishedLaunching method I added:
UINavigationBar.Appearance.BarTintColor = UIColor.Blue;
UINavigationBar.Appearance.TintColor = UIColor.White;
UINavigationBar.Appearance.BackIndicatorImage = UIImage.FromFile("logo_ab.png");
What I get: the background color of the status bar is blue, the "Back" text is in white.
What I expect: no "< back" text. My "logo_ab.png" should be displayed instead.
FYI: the logo is an horizontal file of 90 x 32 px.
What am I doing wrong, can you help?
Thank you.
UPDATE (solved): it seems that I forgot the BackIndicatorTransitionMaskImage. Adding the same as the BackIndicatorImage worked as expected, I could see the logo. But I'm still working to remove the "back" text. For now what I figured out is that if I give a title to the page (in the shared code, in the XAML/ContentPage), that title will be used instead "back", e.g. "Home" for the main page. But the text is displayed over the logo, which is unwanted. If I set as title an empty string for home, (Title="") I get the "back" text over he text. I guess I'm misuising the BackIndicatorImage (as the property says. it should be a Back indicator, not just a custom picture such a logo...) and should leave it as it is (not set it at all and use the standard arrow which is quite ok).
UINavigationBar.Appearance.BarTintColor = UIColor.Blue;
UINavigationBar.Appearance.TintColor = UIColor.White;
UINavigationBar.Appearance.BackIndicatorImage = UIImage.FromFile("logo_ab.png");
UINavigationBar.Appearance.BackIndicatorTransitionMaskImage = UIImage.FromFile("logo_ab.png");
Event registration is overwriting existing delegate
Using the WorkingWithWebview sample project (https://github.com/xamarin/xamarin-forms-samples), in the iOS BaseUrlWebViewRenderer add the following:
protected override void OnElementChanged(VisualElementChangedEventArgs e)
{
this.LoadFinished += OnLoadFinished;
}
private void OnLoadFinished(object sender, EventArgs eventArgs)
{
var i = 0;
}
and then try to run. I get the error:
Unhandled Exception:
System.InvalidOperationException: Event registration is overwriting existing delegate. Either just use events or your own delegate: Xamarin.Forms.Platform.iOS.WebViewRenderer+CustomWebViewDelegate UIKit.UIWebView+_UIWebViewDelegate
The only delegate that I can find is defined is the Application Delegate in Main.cs:
static void Main (string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main (args, null, "AppDelegate");
}
Why would the AppDelegate impact the Webview Events? Does this mean I can't use events at all with Forms?
Set the ContentPage icon from byte[]
Hi, I'm trying to set the icon dynamic from a page.
My image is an byte[], because came from a server.
I tried to do that
`Icon = (FileImageSource)FileImageSource.FromStream(() => new MemoryStream(Usuario.ImagemUsuario));`
But it results on a cast error, ImageSource can't be casted to FileImageSource.
Why the FileImageSource doesn't return a FileImageSource????
There is another way to do that?
Obs, the array is fine, I can load into a Image normally
Xamarin and 3D game development
I have been asked to review Xamarin at work and for business use its looking really good.
As a hobby I also make my own games (iOS and Android). I see Xamarin say to use MonoGame for 3D game development, however I read that uses XNA and is pretty old.
Should I be using it for cross platform 3D games or is there something else I can use with Xamarin (not unity)
How to tap and drag a Slider in iOS
How do you identify and drag a slider element in C# Xamarin.UITest syntax?
app.DragCoordinates ?
So far, I have, in my UI Test, waited for and tapped the slider:
App.WaitForElement (findSliderField);
App.Tap (findSliderField);
where
Func<AppQuery, AppQuery> findSliderField = c => c.Text("SliderField");
but how do I move the slider?
Converting old bindings
After converting the project to Unified, I presume I then need to convert every int to nint etc?
PCL: Box2D.Dynamics.b2World could not be loaded
Hi everyone,
I tried to convert the GoneBananas sample from a SharedProject to a PCL, but when I tap the screen to start the game I get "Box2D.Dynamics.b2World could not be loaded", followed by this exception trace:
[Mono] The class Box2D.Dynamics.b2World could not be loaded, used in CocosSharp, Version=2.2.4.0, Culture=neutral, PublicKeyToken=null
[MonoDroid] UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'FormsGame.Engine.GameLayer' from assembly 'FormsGame.Engine, Version=1.0.5358.40301, Culture=neutral, PublicKeyToken=null'.
[MonoDroid] at CocosSharp.CCEventDispatcher/<>c__DisplayClass6.<DispatchTouchEvent>b__4 (CocosSharp.CCEventListener) <IL 0x000e0, 0x003df>
[MonoDroid] at CocosSharp.CCEventDispatcher.DispatchEventToListeners (CocosSharp.CCEventDispatcher/CCEventListenerVector,System.Func`2<CocosSharp.CCEventListener, bool>) <IL 0x00096, 0x0037c>
[MonoDroid] at CocosSharp.CCEventDispatcher.DispatchTouchEvent (CocosSharp.CCEventTouch) <IL 0x00164, 0x00793>
[MonoDroid] at CocosSharp.CCEventDispatcher.DispatchEvent (CocosSharp.CCEvent) <IL 0x00049, 0x00157>
[MonoDroid] at CocosSharp.CCApplication.ProcessTouch (CocosSharp.CCWindow) <IL 0x002a6, 0x00c57>
[MonoDroid] at CocosSharp.CCApplication.Update (Microsoft.Xna.Framework.GameTime) <IL 0x000b6, 0x0040f>
[MonoDroid] at Microsoft.Xna.Framework.Game.<.cctor>b__19 (Microsoft.Xna.Framework.IUpdateable,Microsoft.Xna.Framework.GameTime) <IL 0x00002, 0x0002e>
[MonoDroid] at Microsoft.Xna.Framework.Game/SortingFilteringCollection`1<Microsoft.Xna.Framework.IUpdateable>.ForEachFilteredItem<Microsoft.Xna.Framework.GameTime> (System.Action`2<Microsoft.Xna.Framework.IUpdateable, Microsoft.Xna.Framework.GameTime>,Microsoft.Xna.Framework.GameTime) <0x001e5>
[MonoDroid] at Microsoft.Xna.Framework.Game.Update (Microsoft.Xna.Framework.GameTime) <IL 0x0000c, 0x00047>
[MonoDroid] at CocosSharp.CCGame.Update (Microsoft.Xna.Framework.GameTime) <IL 0x00002, 0x0002b>
[MonoDroid] at Microsoft.Xna.Framework.Game.DoUpdate (Microsoft.Xna.Framework.GameTime) <IL 0x0001b, 0x00076>
[MonoDroid] at Microsoft.Xna.Framework.Game.Tick () <IL 0x000f5, 0x00693>
[MonoDroid] at Microsoft.Xna.Framework.AndroidGameWindow.OnUpdateFrame (object,OpenTK.FrameEventArgs) <IL 0x00059, 0x0014f>
[MonoDroid] at OpenTK.GameViewBase.OnUpdateFrame (OpenTK.FrameEventArgs) [0x00014] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.14-series/a5d57087/source/monodroid/src/OpenGLES/Android/GameViewBase.cs:312
[MonoDroid] at OpenTK.Platform.Android.AndroidGameView.UpdateFrameInternal (OpenTK.FrameEventArgs) [0x00013] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.14-series/a5d57087/source/monodroid/src/OpenGLES/Android/AndroidGameView.cs:338
[MonoDroid] at OpenTK.Platform.Android.AndroidGameView.RunIteration (System.Threading.CancellationToken) [0x00096] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.14-series/a5d57087/source/monodroid/src/OpenGLES/Android/AndroidGameView.cs:523
[MonoDroid] at OpenTK.Platform.Android.AndroidGameView/<StartThread>c__AnonStorey0.<>m__0 (object) [0x0000d] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.14-series/a5d57087/source/monodroid/src/OpenGLES/Android/AndroidGameView.cs:431
[MonoDroid] at Android.App.SyncContext/<Send>c__AnonStorey1.<>m__0 () [0x00000] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.14-series/a5d57087/source/monodroid/src/Mono.Android/src/Android.App/SyncContext.cs:32
[MonoDroid] at Java.Lang.Thread/RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.14-series/a5d57087/source/monodroid/src/Mono.Android/src/Java.Lang/Thread.cs:36
[MonoDroid] at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) [0x00009] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.14-series/a5d57087/source/monodroid/src/Mono.Android/platforms/android-14/src/generated/Java.Lang.IRunnable.cs:71
[MonoDroid] at (wrapper dynamic-method) object.a0423504-0f53-448f-bd9a-38d1db974e65 (intptr,intptr) <IL 0x00011, 0x0001b>
[mono]
[mono] Unhandled Exception:
[mono] System.TypeLoadException: Could not load type 'FormsGame.Engine.GameLayer' from assembly 'FormsGame.Engine, Version=1.0.5358.40301, Culture=neutral, PublicKeyToken=null'.
[mono] at CocosSharp.CCEventDispatcher+<>c__DisplayClass6.<DispatchTouchEvent>b__4 (CocosSharp.CCEventListener l) [0x00000] in <filename unknown>:0
[mono] at CocosSharp.CCEventDispatcher.DispatchEventToListeners (CocosSharp.CCEventListenerVector listeners, System.Func`2 onEvent) [0x00000] in <filename unknown>:0
[mono] at CocosSharp.CCEventDispatcher.DispatchTouchEvent (CocosSharp.CCEventTouch touchEvent) [0x00000] in <filename unknown>:0
[mono] at CocosSharp.CCEventDispatcher.DispatchEvent (CocosSharp.CCEvent eventToDispatch) [0x00000] in <filename unknown>:0
[mono] at CocosSharp.CCApplication.ProcessTouch (CocosSharp.CCWindow window) [0x00000] in <filename unknown>:0
[mono] at CocosSharp.CCApplication.Update (Microsoft.Xna.Framework.GameTime gameTime) [0x00000] in <filename unknown>:0
[mono] at Microsoft.Xna.Framework.Game.<.cctor>b__19 (IUpdate
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'FormsGame.Engine.GameLayer' from assembly 'FormsGame.Engine, Version=1.0.5358.40301, Culture=neutral, PublicKeyToken=null'.
[mono-rt] at CocosSharp.CCEventDispatcher+<>c__DisplayClass6.<DispatchTouchEvent>b__4 (CocosSharp.CCEventListener l) [0x00000] in <filename unknown>:0
[mono-rt] at CocosSharp.CCEventDispatcher.DispatchEventToListeners (CocosSharp.CCEventListenerVector listeners, System.Func`2 onEvent) [0x00000] in <filename unknown>:0
[mono-rt] at CocosSharp.CCEventDispatcher.DispatchTouchEvent (CocosSharp.CCEventTouch touchEvent) [0x00000] in <filename unknown>:0
[mono-rt] at CocosSharp.CCEventDispatcher.DispatchEvent (CocosSharp.CCEvent eventToDispatch) [0x00000] in <filename unknown>:0
[mono-rt] at CocosSharp.CCApplication.ProcessTouch (CocosSharp.CCWindow window) [0x00000] in <filename unknown>:0
[mono-rt] at CocosSharp.CCApplication.Update (Microsoft.Xna.Framework.GameTime gameTime) [0x00000] in <filename unknown>:0
[mono-rt] at Microsoft.Xna.Framework.Game.<.cctor>b
Does anyone have an idea why this is happening?
Tag-like on entry
Hi,
I need to make an entry with the tag option, like the image:
Someone has any idea?
I tried with grid layout and changing the position of my entry, but that was awful...
Debug deployment to Device works fine, Release fails with odd messages. Anybody have a fix for this?
Hello friends and neighbors. I am running Xamarin Studio latest version on OSX Mavericks. When attempting to deploy to a device (Android 4.1.2), the Debug configuration works fine, but a release configuration (which essentially removes the debug settings) fails and returns the following odd messages:
[monodroid-assembly] Could not load assembly 'MyApp' during startup registration.
[monodroid-assembly] This might be due to an invalid debug instalation.
[monodroid-assembly] A common cause is to 'adb install' the app directly instead of doing from the IDE.
There is a post from nearly a year and a half ago with the same results, but no resolution.
Several questions, if we are to take these messages to heart.
- What is an "invalid debug installation" when attempting to perform a release build?
There is no debug installation.
(NOTE: I have completely removed all traces of the application from the device and reset, but I receive the same result)
- This might be due to an invalid debug instalation.
See (1) above. And check your spelling.
- A common cause is to 'adb install' the app directly instead of doing from the IDE.
This would not be a cause, but it might be a work-around ...
Are we saying that "we don't know what we are doing, so our advice to you is to just bypass our code?" That doesn't instill much confidence in the platform ...
How can I get a reference to the Current Page outside of it?
Let's say I have a long-running background process and I want to show the activity indicator on my current page from the background process. My understanding is that if you are in the page itself, you can just set the IsBusy property to true, but I can't seem to find a way to do it from outside of the page itself. Any suggestions?
Async/Await crashes iOS
I have been trying unsuccessfully to implement some animation sequences using RunActionAsync as per forums.xamarin.com/discussion/34667/cocossharp-v1-3-2-0-release. When I add the await the app crashes. I have created an 'empty cocossharp' project, added the NuGet package Microsoft.Bcl.Async as per the link above, tried with and without the using system.threading & system.threading.task. This is the sample code I am running.
`
async void Move()
{
CCMoveTo movevar;
if (Forward)
{
movevar = new CCMoveTo (2.0f, firstPoint);
label.Text = "First";
}
else
{
movevar = new CCMoveTo (2.0f, secondPoint);
label.Text = "Second";
}
Forward = !Forward;
await mySprite.RunActionAsync (movevar);
label.Text = "Finished";
}
`
In case you want to follow this Rey @ReynaldoGalindo.
Android Player Displays OpenGL Error
Using Xamarin Android Player version 0.0.25 on MacBook Pro running OS X 10.9.5.
Running either one of the currently available Nexus virtual machines displays the following error in a popup window:
"OpenGL server is unreachable. Please check that Xamarin Android Player is allowed through your firewall on public networks."
Clicking the OK button on the popup will hide the Android Player virtual machine window, but the virtual machine itself will continue to run in the background until I click the Stop button on the Devices list.
The OS X firewall is turned off.
When watching the preview window in VirtualBox 4.3 the virtual machine continues to boot and eventually will display the Android home screen within the VirtualBox preview window.
I have tried uninstalling both the Android Player and VirtualBox, but am still encountering the same problem.
Is there anything else I should try?
trying to find ibeacons with following code not working
Hi - bit new to iOS and Xamarin. Trying to identify all nearby beacons with a specific UUID. I wrote the following code and thought this should do the trick but execution never reaches the "found beacon" part. UUID is correct, I see the beacons in other apps, and my app has all the necessary location permission.
public void startBeaconSearch()
{
region = new CLBeaconRegion (new NSUuid(defaults.uuid),"nearme");
region.NotifyOnEntry = true;
locationManager.RegionEntered += (s,e) => {
Console.WriteLine("Found Beacon");
};
locationManager.StartMonitoring(region);
}
Can anyone help? What is the best way to get a list of beacons in range?
thanks
Chris
StartActivityForResult
From a Xamarin.Forms.ContentPage (not the MainPage), how can I start an Android StartActivityForResult and how do I catch the OnActivityResult ? Somehow I'm missing the current android-activity, also not in Android.ExportRenderer : ContentPage.
Tom
Shared ImageSource
Hello there,
I'm working on some kind of app that displays same images in single view. I'm using ImageSource.FromResource("resourceId")
to load bitmap from resources:
var source = ImageSource.FromResource("img");
var img1 = new Image { Source = source };
var img2 = new Image { Source = source };
It seems that doesn't work. Is there any way to share same bitmap between many Image
instances?
Can't target api 22
I've updated to the latest 5.9.2(build4) and xamarin.android 5.1.2.1 .
Installed api 22 - 5.1.1 and can't select it.
For example in Target android version, the latest selectable is 5.0 (api level21).
Thank you.
Xamarin Studio never shows where the exception is getting thrown.
In the beginning, a few months ago, when I first started developing my app, it was working fine.
Now all I get is this window which is useless:
If I check Application Output I get a much more meaningful error:
apple watch
Hi,
Has anyone got experience with the apple watch kit.
I was wandering if there was any restriction in terms of what sort of interact you can have on a page. Is possible to create a bespoke interface or do you have to use the control provided. I'd like to do a dial type of interface to select the relevant section.
Many thanks
Seb
MasterDetailPage Windows Phone (WP) Master dismissed
I have a MasterDetailPage which I use for filtering a list. The Master contains the filter dropdown boxes, and the Detail contains the list off results. On Windows Phone, whenever I select an item from the dropdownbox, the Master is dismissed. iOS and Android work fine. Is there any way to prevent this?