Questions tagged [xamarin.ios]

Xamarin.iOS (previously known as MonoTouch) is a commercial software development kit for Mac OS X and Windows that lets you use C# (a .NET programming language) to create native applications for Apple iPhone, iPod Touch, iPad (iOS), Apple Watch (watchOS) and AppleTV (tvOS) devices.

Xamarin.iOS (previously known as MonoTouch) is a cross-platform implementation of Microsoft's CLI (.NET) that lets developers write "once" for iOS, OS X, Android, and Windows Phone in C#.

Xamarin comprises an IDE (Xamarin Studio for OS X and Windows), a plugin for Visual Studio, and libraries for each of the target OS's. Xamarin implements a hybrid approach to cross-platform development, whereby business logic exists in a shared core project, and the visual layer is implemented in platform-specific projects for each target platform.

Developers thus have access to advanced C# language features and libraries, as well as platform-specific UI libraries. To comply with Apple policy, iOS and OS X apps compile "all the way out" so as not to require a runtime.

16577 questions
32
votes
2 answers

C#: Unable to cast object of type 'System.Int64' to type 'System.Int32'

I have code as follows: Dictionary dict = ... Color = (int)dict.GetValue("color"); When I convert the Color to an int, I get the following exception: System.InvalidCastException: Unable to cast object of type 'System.Int64' to…
Kostub Deshmukh
  • 2,852
  • 2
  • 25
  • 35
32
votes
5 answers

Write device platform specific code in Xamarin.Forms

I have the following Xamarin.Forms.ContentPage class structure public class MyPage : ContentPage { public MyPage() { //do work to initialize MyPage } public void LogIn(object sender, EventArgs eventArgs) { bool…
Michael Kniskern
  • 24,792
  • 68
  • 164
  • 231
32
votes
1 answer

How do I tell my boss working with Xamarin will not make it faster

I am the only mobile developer in my job. Before I was hired, my currently boss was thinking on using Xamarin as their marketing says the words Shared code and native. I consider myself an advanced Android developer since I've build large…
Christopher Francisco
  • 15,672
  • 28
  • 94
  • 206
32
votes
4 answers

UIColor from Hex in Monotouch

How to get a UIColor from an hex value in Monotouch?
Luis
  • 5,979
  • 2
  • 31
  • 51
31
votes
5 answers

Is MonoGame reliable?

I'm looking for a cross-platform game development framework. MonoGame looks easy to learn and fast to develop, but I see most of the games featured at their page do not work, or have a lot of bugs. Can anyone explain if MonoGame is reliable for…
xus
  • 2,587
  • 8
  • 31
  • 44
31
votes
1 answer

Extended UIButton border is not initially drawn

I am trying to create a custom UIButton which extends from UIButtonType.RoundedRect. My added functionality is working, but there is an issue with the initial rounded border state of my button. The border of my extended button is not drawn until…
Scott
  • 21,211
  • 8
  • 65
  • 72
29
votes
3 answers

MKCoordinateSpan in Meters?

I need to create a MKCoordinateSpan that is about 500 meters. How do I calculate the values to pass into the MKCoordinateSpan constructor? Answers in any programming (Obj-C, .Net) language are fine.
Ian Vink
  • 66,960
  • 104
  • 341
  • 555
29
votes
6 answers

"The XamarinTelemetry task failed unexpectedly" on second build

With the latest VS preview (VS 17.3 Preview 3), with both Android and iOS, building my application works the first time I build it, but the second time it fails with The "XamarinTelemetry" task failed unexpectedly. Looking at the logs I see…
28
votes
5 answers

Visual Studio 2022 won't connect via SSH on macOS after upgrading to Ventura

I have a working setup with Visual Studio 2022 17.3.6 on a Windows laptop and Mac M1 running macOS 12.6.1. When I run an Uno project or a Xamarin project it connects as expected to the Mac. I just upgraded the Mac to Ventura and am no longer able to…
Jt5
  • 694
  • 5
  • 11
28
votes
2 answers

Monotouch Three20 app launcher or bindings

From what I've read about btouch; the bindings are not complete for three20. Is there a project that provides either bindings for the Three20 app launcher or a pure MonoTouch implementation of a launcher UI element?…
detroitpro
  • 3,853
  • 4
  • 35
  • 64
28
votes
4 answers

Does UIButton become disabled when its alpha is set to 0.0?

I have a few buttons in my app whose alpha is currently set to zero. These buttons are completely non-responsive, but as soon as I increase their alpha, they begin to respond. Is this expected behavior?
CodeBlue
  • 14,631
  • 33
  • 94
  • 132
27
votes
5 answers

UIImage loaded from URL in Xamarin / C#

It has been 4 years since this question has been answered with this blog post. Is there a standard way to create a UIImage with an image from a URL? Something like: UIImage image = UIImage.FromFile("http://foo.com/bar.jpg"); I feel like I'm…
Jason Hartley
  • 2,459
  • 1
  • 31
  • 40
27
votes
7 answers

Monotouch or Titanium for rapid application development on IPhone?

As a .NET developer, I always dreamed for the possibility to develop with my existing skills (C#) applications for the iPhone. Both programs require a Mac and the iPhone SDK installed. Appcelerator Titanium was the first app I tried, and it is based…
Ronnie
  • 4,959
  • 10
  • 51
  • 69
26
votes
3 answers

Official way to create iOS icons?

I find it hard to believe that every developer creates their icons manually in various different ways but if that is the case, that is fine. I was wonder what the standard was for creating iOS icons (home screen icons, etc.)
Brian David Berman
  • 7,514
  • 26
  • 77
  • 144
26
votes
3 answers

How to get Device Id in Xamarin Forms?

How can I get Device Unique Id in Android and iOS using c# in Xamarin Froms? I am using Azure Notification Hub for sending Notification. I am referring this blog. But in Android I am not able to find related "Settings"