Xamarin Tips: Visual Studio is not responding after stoping an iOS app.
I found there are a number of times, in Visual Studio, when I stopped an iOS app. My visual studio became not responding and holding up for more than a minute. I found the issue, that may be because of I used a Mac Book and a real PC(not a VM) to build, there may have network issues. The issue is between iOS build host and Visual Studio. After I close iOS Build Host, and open it again, then visual studio is working normally.
Xamarin : Access style in the code behind
I defined all styles in app.xaml, which is a kind of css style and that is the centralised place to manage the look and feel. I think that is a good practice. That is no problems to access the style across other xaml file. But in code behind, how do I get it working
That is simple,
Please don't user only Resources["name"] which is only calling Resources Dictionary in your local xaml, not global app.xaml. You will get a NullReferenceException
Disable Scroll Bar in ListView
I am building an app which has a number of listviews, for some phone it will be longer than its screen. So a global scroll bar are required. However, the listview has their own scrollbar bar, It will make scrolling some strange! Thus, I need to disable all scrollbar, only leaving the global bar.
There are no properties in ListView control to disable its scroll bars. The only way to do that is set HeightRequest to a super big number.
I wish in their future version can have this useful feature.
PCL vs Shared Projects in Xamarin Forms
I am not an expert in Xamarin. I only have spent 6 months on this programming platform. Thus, please feel free to response this post.
My frist preference is to Shared Projects. That is easier to manage. I can share xmal files across each project. That is simple, I think that is good to use in a small and one-off project.
However, if you have more focus on reuse, I think you choose PCL. That is more like a standard control library. You can use the controls in the library easily! Also, you are building a larger scale project, I think that is safer to use PCL, because PCL is more self-contained.
I think using PCL or Shared Projects is depending your project scale and goals.
Accessing the control from CustomRenderer
In Xamarin Form, you have to know how to use CustomRender. You need to use it to preform some platform specific functions. However, we need to access some properties from CustomRenderer to Xamarin Form Control, such as its height and width, That is very easy to do, you just need to use Element property.