How to construct custom views in xamarin

前端 未结 3 423
渐次进展
渐次进展 2021-01-04 11:35

Is there any tutorial which will enable me to design custom views in xamarin?I want to build pinch zoom functionality for my android app using xamarin.

I have tried

相关标签:
3条回答
  • 2021-01-04 12:29

    I would suggest checking out this Java Android tutorial to get an idea of what you need to setup:

    http://developer.android.com/training/custom-views/index.html

    You may need to create an attributes xml file for your custom view.

    Another approach you may want to consider is to use a fragment instead of a view:

    http://docs.xamarin.com/guides/android/platform_features/fragments/fragments_walkthrough

    0 讨论(0)
  • 2021-01-04 12:33

    In the layout file you need to write the path to your class in small letters. For me Core.Droid.MyImageView had to be written as core.droid.MyImageView.

    I am not sure if only the first letter or all letter have to be written in small, but you can try either lA_Application.ZoomView or la_application.ZoomView. One of them will very likely work :)

    0 讨论(0)
  • 2021-01-04 12:33

    Here is the skeleton of how to create a custom view in xamarin.android

    http://xandroid4net.blogspot.com/2014/09/custom-view.html

    Then take Emmanuel Touzery answer and add it to the skeleton

    android pinch zoom

    0 讨论(0)
提交回复
热议问题