Skip to main content

Mobile

Why does MVVMCross view model initialize twice on iOS?

·2 mins

Working on a bug fix in MVVMCross-based mobile application I noticed a strange behavior. The navigation to other view model I put in async Init<TInit>(TInit parameters) which as executed on the first view model in my app was running twice. After a short debugging session it turned out that MvxViewModel<TInit> Init() is called from the view controllers ViewDidLoad() method. Obviously there was something I was missing in terms of ViewDidLoad() semantics.

Detecting device resolution in Xamarin apps

·2 mins

Considering Xamarin there can be many reasons for need of screen resolution detection in mobile app. You may have more complex logic of loading your resources possibly split between PCL and Android/iOS projects. Other might want to send this information with REST request for reporting. Whatever your reason is, here is a very short text on how to do it in IoC-friendly way.

How to add padding to UILabel in Xamain.iOS

·2 mins

Working with mobile can be quite challenging for a developer with a web dev background. At least that is my experience so far. Comparing to typical HTML web elements with CSS styling some features might be missing.