xamarin.android

Portable Class Library project - reference assemblies not installed?

人走茶凉 提交于 2019-12-11 08:15:19
问题 I'm using Xamarin Studio Version 4.2.3 on a Mac (Starter Edition; Mono 3.2.6; Xamarin.Android Version 4.12.1; Xamarin.iOS Version 7.2.02). I created a blank solution. I added an Android application project and an iPhone application project. Both build and run okay. Now I've added a Portable Class Library project which I want to link to from my application projects. However! My Portable Class Library project is showing up an error in my References folder for the .NET Portable Subset reference,

How to remove ViewTreeObserver in Xamarin?

半城伤御伤魂 提交于 2019-12-11 08:03:03
问题 Let's just say I need to get and set a View's height. In Android, it's known you can get a view height only after it's drawn. If you're using Java, many answers, one of the most well-known way is like this one below, taken from this answer: view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { view.getViewTreeObserver().removeOnGlobalLayoutListener(this); view.getHeight(); //height is ready } }); Thus I

Error when making bind ObservableCollection<string> for a MvxListView

可紊 提交于 2019-12-11 07:50:56
问题 After update MvvmCross for the last version, i started having an error: MvxBind:Error:1679,46 Exception thrown during the view binding MvxException: Unknown serialized description. This error occurs only in this bind. If i do bind for a ObservableCollection<Class A> everything works fine. I have a template for a MVXListView: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto"

Type cast Java Object to my class

点点圈 提交于 2019-12-11 07:33:46
问题 Developing application in C# .Net 4.5 using Xamarin, targeting Android. I have a custom class that has some properties in it. I am trying to use a built in component that does comparison using Java.Util.IComparator and Java.Lang.Object. Because it is a built in component, I don't have much flexibility into changing those two items. My custom class is named recBatch and inside of it, I have some properties of integers and strings. This is where the component gets initialized. It basically

Change icon on Navigation bar - Xamarin.Forms Android

天大地大妈咪最大 提交于 2019-12-11 07:25:39
问题 How can I set different icons in Xamarin.Forms - android. One for the application, play store, user screen and other for the navigation page. I updated Project.Droid/MainActivity.cs file: [Activity(Label = "MyAppName", Icon = "MyIconName", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] But this way change two icons!! Other way that I did, I updated ProjectForms/App.cs: Current.Resources = new ResourceDictionary(); Current.Resources.Add(

Mvvmcross Android - Rotating fragment view during viewmodel population

空扰寡人 提交于 2019-12-11 07:17:56
问题 I'm having a problem when I try to manually re hydrate fragment viewmodels while rotating. Everything seems to work fine when I rotate a fragment once my viewmodel has been populated, all I do is : this.viewmodel = foo but if I try to rotate the fragment during population (e.g. from a web service) and then re-attach the stored viewmodel before population has completed the view doesn't appear to bind properly. I know there is a lack of source (in this post) but I was wondering whether this

How to evaluate javascript in Xamarin.Android/Monodroid and retrieve result?

假装没事ソ 提交于 2019-12-11 07:14:48
问题 For Xamarin.iOS/Monotouch it is simple to retrieve a string when evaluating javascript . e.g. string elementValue = browser.EvaluateJavascript("document.getElementById('Id').value"); if(elementValue != "") { DoSomething(); } Could anybody provide an example of how to do this for Xamarin. Android/Monodroid using loadURL(javascript:)? 来源: https://stackoverflow.com/questions/22100373/how-to-evaluate-javascript-in-xamarin-android-monodroid-and-retrieve-result

Filterable adapter with custom object

浪子不回头ぞ 提交于 2019-12-11 06:57:33
问题 I want to add autocomplete text-box to the list-view(custom object) in xamarin.android. I have a listview which is being populated from string array. I would like to populate my listview using custom object. The code below works but for string array. Any help to implement my adapter for custom object would help. Here is the code: Main.axml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android

DequeueBuffer exception

落花浮王杯 提交于 2019-12-11 06:50:02
问题 I am stress testing my MonoDroid app. Each loop through the test involves giving the app a simple input, then updating the UI. I am consistently seeing the following after 97 loops through the stress test. Afterwards, the UI no longer updates: [Surface] dequeueBuffer failed (Invalid argument) [ViewRootImpl] Could not lock surface [ViewRootImpl] java.lang.IllegalArgumentException [ViewRootImpl] at android.view.Surface.nativeLockCanvas(Native Method) [ViewRootImpl] at android.view.Surface

MvvmCross: Android Application attribute

一个人想着一个人 提交于 2019-12-11 06:39:33
问题 When using MvvmCross for Android, where is the actual Application object normally used by Android? This object is not always needed unless you want to customize the tag in the manifest. Mono for Android has a ApplicationAttribute that you can use to decorate the Application class and change themes, icons, etc. How would I do this when using MvvmCross? 回答1: MvvmCross sits on top of Xamarin.Android So you can customise an MvvmCross Android application in exactly the same way as you customise a