xamarin.android

Visual Studio / Xamarin OnClickListener

不羁的心 提交于 2019-12-11 12:35:32
问题 I'm new to programming, so I apologise if this is a stupid question! I'm building an app in VS15/Xamarin, and am trying to set an onClickListener, however it keep stelling me there is an error "The type name 'OnClickListener' does not exist in the type 'View'". I've tried a number of solutions, but clearly I'm missing something! This is my code: using System; using Android.App; using Android.Content; using Android.Runtime; using Android.Views; using Android.Widget; using Android.OS; namespace

Child properties update calling it's parent's `OnPropertyChanged`

安稳与你 提交于 2019-12-11 12:25:18
问题 I'm trying to create a XF component whose some properties are of a type that inherits from BindableObject . For illustrating, I have class Shadow with double Radius and Color ShadowColor properties and a class MyBoxText , that have a bool IsLoading and a Shadow Ghost properties. My View and it's Bindings is working as expected, but I have an issue with it's custom renderer: When I change the Ghost properties I need to redraw the entire view (of the MyBoxText control), to visually update the

Xamarin.Android APK crashes following migration to Visual Studio Team Services (VSTS)

倖福魔咒の 提交于 2019-12-11 12:08:17
问题 We've got a mobile application (Xamarin.Forms for iOS and Android) that we've been in the progress of migrating from our on-premise Team Foundation Server (TFS) to Visual Studio Team Services (VSTS). For the last couple of months now we've hosted our code in VSTS but have performed the builds and releases to the respective stores from our on-premise TFS. Late last week I migrated both the build and release definitions to VSTS as well, so that now we have the entire process in VSTS. Or so I

Is it possible to ignore Attributes in C#? Or disable the processing of them?

南笙酒味 提交于 2019-12-11 11:18:36
问题 In C# we can decorate methods with Attributes for numerous purposes. E.g: [Activity (Label = "My Activity", MainLauncher = true)] public class MainActivity : Activity This particular example is from Xamarin, it goes off and auto builds the Android Manifest file based on these attributes. I want to know if there is any way to get the compiler to globally ignore these attributes? i.e Disable Attribute processing altogether. My actual end goal is to manually generate my Android Manifest file

Do custom fonts work for formatted string?

寵の児 提交于 2019-12-11 11:09:51
问题 I have followed Sven's example for custom font for formattedstrings here: https://github.com/smstuebe/xamarin-forms-formattedtext However, I'm running into a strange issue where the tap gestures on my view don't work if I implement the UIFormattedStringLabel(). This is super strange because if I use a regular label that does not use the custom renderer provided, the gestures are detected, the formatted string is displayed (just the fonts are default) and everything loads correctly. So, I

Releasing a bitmap attached to an ImageView

六月ゝ 毕业季﹏ 提交于 2019-12-11 10:52:29
问题 I have a basic activity (SherlockActivity subclass), and the view it loads has a single, max-sized ImageView. <LinearLayout xmlns:p1="http://schemas.android.com/apk/res/android" p1:orientation="vertical" p1:minWidth="25px" p1:minHeight="25px" p1:layout_width="fill_parent" p1:layout_height="fill_parent" p1:id="@+id/linearLayout1"> <ImageView p1:src="@android:drawable/ic_menu_gallery" p1:layout_width="fill_parent" p1:layout_height="fill_parent" p1:id="@+id/imageView" p1:scaleType="fitCenter" />

MvxBind:Error: View type not found - mvvmemiextensions.EmiDatePicker

ε祈祈猫儿з 提交于 2019-12-11 10:49:46
问题 I'm using EmiDatePicker but, at open the View a this Error occurs: MvxBind:Error:452,00 View type not found - mvvmemiextensions.EmiDatePicker 03-13 16:31:21.439 I/mono-stdout(20760): MvxBind:Error:452,00 View type not found - mvvmemiextensions.EmiDatePicker [0:] MvxBind:Error:452,00 View type not found - mvvmemiextensions.EmiDatePicker At AXML... <mvvmemiextensions.EmiDatePicker local:MvxBind="Value SomeDateValue" android:layout_width="fill_parent" android:layout_height="wrap_content" android

Monodroid Take a picture with Camera

半世苍凉 提交于 2019-12-11 10:47:01
问题 I have tried it myself with no success, I can do it in java but it is a good bit different in C#. Any help would be great.All I want is to: Launch the camera. Take a photo. View the photo in an image view. 回答1: I know this is a fairly old question, but I'll answer it with my code that I've used. In my experience messing around with this, not all devices are able to use the standard intent and return data back in the OnActivityResult . private void TakePicture() { if (PackageManager

How to run accelerometer on background?

可紊 提交于 2019-12-11 10:35:20
问题 I need to implement accelerometer running on background service on Android. The thread has to communicate both way and fire event based on accelerometer data. The service has to run indefinitely and in case that OS kills service, it restarts from previous state. I did some research and I am not sure whether to use Bound Service or Out of process Service. Is it possible to implement this task? Which type of service works for this problem? 回答1: Is it possible to implement this task? Which type

Get Height/Width of imageView from Android.Support.V4.Fragment(always return zero)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 10:34:01
问题 I'm using V4. Fragments . So from activity i'm creating new instance of my fragment and after that i begin transaction. The main problem,that my imageview control is defined(in axml) as Layout_width="match_parent" and weightSum=1 (for height). For some reason i need to know height / width of my imageView. What i tried : was created class that implements IOnGlobalLayoutListener class GlobalLayoutListener : Java.Lang.Object, ViewTreeObserver.IOnGlobalLayoutListener { System.Action